Commit 69ef83c6 authored by SergeyLuzyanin's avatar SergeyLuzyanin

fix Bug 35197

parent ac47c98e
...@@ -3448,7 +3448,9 @@ CChartSpace.prototype.checkEmptySeries = function() ...@@ -3448,7 +3448,9 @@ CChartSpace.prototype.checkEmptySeries = function()
} }
return false; return false;
}; };
for(var i = 0; i < series.length; ++i) var nChartType = chart_type.getObjectType();
var nSeriesLength = (nChartType === AscDFH.historyitem_type_PieChart || nChartType === AscDFH.historyitem_type_DoughnutChart) ? 1 : series.length;
for(var i = 0; i < nSeriesLength; ++i)
{ {
var ser = series[i]; var ser = series[i];
if(ser.val) if(ser.val)
...@@ -5919,8 +5921,8 @@ CChartSpace.prototype.recalculateAxis = function() ...@@ -5919,8 +5921,8 @@ CChartSpace.prototype.recalculateAxis = function()
cat_ax.labels.extY = max_rotated_height + labels_offset; cat_ax.labels.extY = max_rotated_height + labels_offset;
// //
left_gap_point = Math.min.apply(Math, arr_left_points); left_gap_point = Math.max(0, Math.min.apply(Math, arr_left_points));
right_gap_point = Math.max.apply(Math, arr_right_points); right_gap_point = Math.max(0, Math.max.apply(Math, arr_right_points));
if(!bWithoutLabels){ if(!bWithoutLabels){
if(AscFormat.ORIENTATION_MIN_MAX === cat_ax_orientation) if(AscFormat.ORIENTATION_MIN_MAX === cat_ax_orientation)
...@@ -8260,7 +8262,7 @@ CChartSpace.prototype.hitInTextRect = function() ...@@ -8260,7 +8262,7 @@ CChartSpace.prototype.hitInTextRect = function()
legend_width = max_legend_width; legend_width = max_legend_width;
} }
var max_entry_height2 = Math.max.apply(Math, arr_heights); var max_entry_height2 = Math.max(0, Math.max.apply(Math, arr_heights));
for(i = 0; i < arr_heights.length; ++i) for(i = 0; i < arr_heights.length; ++i)
arr_heights[i] = max_entry_height2; arr_heights[i] = max_entry_height2;
...@@ -8348,7 +8350,7 @@ CChartSpace.prototype.hitInTextRect = function() ...@@ -8348,7 +8350,7 @@ CChartSpace.prototype.hitInTextRect = function()
b_reverse_order = true; b_reverse_order = true;
} }
var max_entry_height2 = Math.max.apply(Math, arr_heights); var max_entry_height2 = Math.max(0, Math.max.apply(Math, arr_heights));
for(i = 0; i < arr_heights.length; ++i) for(i = 0; i < arr_heights.length; ++i)
arr_heights[i] = max_entry_height2; arr_heights[i] = max_entry_height2;
if(max_content_width < max_legend_width - left_inset) if(max_content_width < max_legend_width - left_inset)
...@@ -8480,7 +8482,7 @@ CChartSpace.prototype.hitInTextRect = function() ...@@ -8480,7 +8482,7 @@ CChartSpace.prototype.hitInTextRect = function()
summ_width+=arr_width[arr_width.length-1]; summ_width+=arr_width[arr_width.length-1];
} }
var max_entry_height = Math.max.apply(Math, arr_height); var max_entry_height = Math.max(0, Math.max.apply(Math, arr_height));
var cur_left_x = 0; var cur_left_x = 0;
if(summ_width < max_legend_width)//значит все надписи убираются в одну строчку if(summ_width < max_legend_width)//значит все надписи убираются в одну строчку
...@@ -8680,7 +8682,7 @@ CChartSpace.prototype.hitInTextRect = function() ...@@ -8680,7 +8682,7 @@ CChartSpace.prototype.hitInTextRect = function()
summ_width += arr_width[arr_width.length-1]; summ_width += arr_width[arr_width.length-1];
} }
var max_entry_height = Math.max.apply(Math, arr_height); var max_entry_height = Math.max(0, Math.max.apply(Math, arr_height));
var cur_left_x = 0; var cur_left_x = 0;
if(summ_width < max_legend_width)//значит все надписи убираются в одну строчку if(summ_width < max_legend_width)//значит все надписи убираются в одну строчку
{ {
...@@ -8788,7 +8790,7 @@ CChartSpace.prototype.hitInTextRect = function() ...@@ -8788,7 +8790,7 @@ CChartSpace.prototype.hitInTextRect = function()
max_content_width = cur_content_width; max_content_width = cur_content_width;
arr_heights.push(calc_entry.txBody.getSummaryHeight()); arr_heights.push(calc_entry.txBody.getSummaryHeight());
} }
max_entry_height = Math.max.apply(Math, arr_heights); max_entry_height = Math.max(0, Math.max.apply(Math, arr_heights));
if(max_content_width < max_legend_width - left_inset && !bFixedSize) if(max_content_width < max_legend_width - left_inset && !bFixedSize)
{ {
legend_width = max_content_width + left_inset; legend_width = max_content_width + left_inset;
......
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