Commit b71d77ec authored by Sergey Luzyanin's avatar Sergey Luzyanin

поправлен баг с неправильной позицией легенды, когда legendPos приходит null

parent 707d0905
......@@ -463,8 +463,18 @@ CChartSpace.prototype.recalculate = function()
if(b_recalc_legend && this.chart && this.chart.legend)
{
var bResetLegendPos = false;
if(!AscFormat.isRealNumber(this.chart.legend.legendPos))
{
this.chart.legend.legendPos = c_oAscChartLegendShowSettings.bottom;
bResetLegendPos = true;
}
var pos = this.chartObj.reCalculatePositionText("legend", this, this.chart.legend);
this.chart.legend.setPosition(pos.x, pos.y);
if(bResetLegendPos)
{
this.chart.legend.legendPos = null;
}
}
if(this.recalcInfo.recalculateBounds)
......
......@@ -6161,7 +6161,7 @@ CChartSpace.prototype =
}
else if(!isRealObject(legend.layout) || !isRealObject(legend.layout.manualLayout))
{
legend_pos = c_oAscChartLegendShowSettings.left;
legend_pos = c_oAscChartLegendShowSettings.bottom;
}
var legend_width, legend_height;
if(AscFormat.isRealNumber(legend_pos)
......
......@@ -557,8 +557,18 @@ CChartSpace.prototype.recalculate = function()
if(b_recalc_legend && this.chart && this.chart.legend)
{
var bResetLegendPos = false;
if(!AscFormat.isRealNumber(this.chart.legend.legendPos))
{
this.chart.legend.legendPos = c_oAscChartLegendShowSettings.bottom;
bResetLegendPos = true;
}
var pos = this.chartObj.reCalculatePositionText("legend", this, this.chart.legend);
this.chart.legend.setPosition(pos.x, pos.y);
if(bResetLegendPos)
{
this.chart.legend.legendPos = null;
}
}
if(this.recalcInfo.recalculateBounds)
......
......@@ -465,8 +465,18 @@ CChartSpace.prototype.recalculate = function()
if(b_recalc_legend && this.chart && this.chart.legend)
{
var bResetLegendPos = false;
if(!AscFormat.isRealNumber(this.chart.legend.legendPos))
{
this.chart.legend.legendPos = c_oAscChartLegendShowSettings.bottom;
bResetLegendPos = true;
}
var pos = this.chartObj.reCalculatePositionText("legend", this, this.chart.legend);
this.chart.legend.setPosition(pos.x, pos.y);
if(bResetLegendPos)
{
this.chart.legend.legendPos = null;
}
}
if(this.recalcInfo.recalculateTextPr)
{
......
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