Commit b36eab66 authored by Sergey Luzyanin's avatar Sergey Luzyanin Committed by Alexander.Trofimov

Обернул создание ChartSapce в ExecuteNoHistory

parent fe5617ad
...@@ -318,44 +318,45 @@ function CSparklineView() ...@@ -318,44 +318,45 @@ function CSparklineView()
} }
CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGroup, worksheetView) CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGroup, worksheetView)
{ {
this.ws = worksheetView; ExecuteNoHistory(function(){
var settings = new asc_ChartSettings(); this.ws = worksheetView;
switch(oSparklineGroup.type) var settings = new asc_ChartSettings();
{ switch(oSparklineGroup.type)
case Asc.ESparklineType.Column:
{
settings.type = c_oAscChartTypeSettings.barNormal;
break;
}
case Asc.ESparklineType.Stacked:
{
settings.type = c_oAscChartTypeSettings.barStacked;
break;
}
default:
{ {
settings.type = c_oAscChartTypeSettings.lineNormal; case Asc.ESparklineType.Column:
break; {
settings.type = c_oAscChartTypeSettings.barNormal;
break;
}
case Asc.ESparklineType.Stacked:
{
settings.type = c_oAscChartTypeSettings.barStacked;
break;
}
default:
{
settings.type = c_oAscChartTypeSettings.lineNormal;
break;
}
} }
} var ser = new asc_CChartSeria();
ser.Val.Formula = oSparkline.f;
var ser = new asc_CChartSeria(); var chartSeries = {series: [ser], parsedHeaders: {bLeft: false, bTop: false}};
ser.Val.Formula = oSparkline.f; var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true);
var chartSeries = {series: [ser], parsedHeaders: {bLeft: false, bTop: false}}; chart_space.setWorksheet(worksheetView.model);
var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true); this.chartSpace = chart_space;
chart_space.setWorksheet(worksheetView.model); var oBBox = worksheetView.model.getCell(oSparkline.sqref);
this.chartSpace = chart_space; this.col = oBBox.c1;
var oBBox = worksheetView.model.getCell(oSparkline.sqref); this.row = oBBox.r1;
this.col = oBBox.c1; this.extX = worksheetView.getColumnWidth(oBBox.c1, 3);
this.row = oBBox.r1; this.extY = worksheetView.getRowHeight(oBBox.r1, 3);
this.extX = worksheetView.getColumnWidth(oBBox.c1, 3); CheckSpPrXfrm(this.chartSpace);
this.extY = worksheetView.getRowHeight(oBBox.r1, 3); this.chartSpace.spPr.xfrm.setOffX(0);
CheckSpPrXfrm(this.chartSpace); this.chartSpace.spPr.xfrm.setOffY(0);
this.chartSpace.spPr.xfrm.setOffX(0); this.chartSpace.spPr.xfrm.setExtX(this.extX);
this.chartSpace.spPr.xfrm.setOffY(0); this.chartSpace.spPr.xfrm.setExtY(this.extY);
this.chartSpace.spPr.xfrm.setExtX(this.extX); this.chartSpace.recalculate();
this.chartSpace.spPr.xfrm.setExtY(this.extY); }, this, []);
this.chartSpace.recalculate();
}; };
CSparklineView.prototype.draw = function(graphics) CSparklineView.prototype.draw = function(graphics)
...@@ -366,14 +367,17 @@ CSparklineView.prototype.draw = function(graphics) ...@@ -366,14 +367,17 @@ CSparklineView.prototype.draw = function(graphics)
var extY = this.ws.getRowHeight(this.row, 3); var extY = this.ws.getRowHeight(this.row, 3);
if(Math.abs(this.extX - extX) > 0.01 || Math.abs(this.extY - extY) > 0.01) if(Math.abs(this.extX - extX) > 0.01 || Math.abs(this.extY - extY) > 0.01)
{ {
this.chartSpace.spPr.xfrm.setExtX(extX); ExecuteNoHistory(function(){
this.chartSpace.spPr.xfrm.setExtY(extY); this.chartSpace.spPr.xfrm.setExtX(extX);
this.chartSpace.spPr.xfrm.setExtY(extY);
}, this, []);
this.extX = extX; this.extX = extX;
this.extY = extY; this.extY = extY;
this.chartSpace.recalculate(); this.chartSpace.recalculate();
} }
graphics.m_oCoordTransform.tx = x; graphics.m_oCoordTransform.tx = x;
graphics.m_oCoordTransform.ty = y; graphics.m_oCoordTransform.ty = y;
this.chartSpace.draw(graphics);
}; };
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment