Commit 7a4f5a7f authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

учитываю масштаб при построении легенды в несколько строк(сверху и снизу)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50170 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a138c50
......@@ -727,7 +727,7 @@ function calcAllMargin(isFormatCell,isformatCellScOy,minX,maxX,minY,maxY, chart)
//длинные подписи, или их большое количество разделяем на несколько строк
bar._otherProps._key_levels = getLevelsKey(chartCanvas, context, font, scale);
var level = 0;
var level = 1;
if(bar._otherProps._key_levels && bar._otherProps._key_levels.length)
level = bar._otherProps._key_levels.length;
......@@ -2644,7 +2644,7 @@ function getLevelsKey(chartCanvas, context, font, scale)
var widthLine = 28;
if(bar.type == 'bar' || bar.type == 'hbar' || bar.type == 'hbar' || (bar.type == 'line' && bar._otherProps_filled) || bar.type == 'pie')
widthLine = 8;
var maxWidthOneLineKey = 0.9*chartCanvas.width;
var maxWidthOneLineKey = 0.9*chartCanvas.width*scale;
var widthRow = 0;
var level = 0;
var levelKey = [];
......@@ -2653,8 +2653,8 @@ function getLevelsKey(chartCanvas, context, font, scale)
var allWidthKeys = 0;
for(var i = 0; i < bar._otherProps._key.length; i++)
{
widthText = getMaxPropertiesText(context,font,bar._otherProps._key[i]).width/scale;
allWidthKeys += widthText + 2 + widthLine;
widthText = getMaxPropertiesText(context,font,bar._otherProps._key[i]).width;
allWidthKeys += (widthText + 2 + widthLine)*scale;
}
if(allWidthKeys > maxWidthOneLineKey)
......@@ -2675,8 +2675,8 @@ function getLevelsKey(chartCanvas, context, font, scale)
var keyOnOneLevel = Math.floor(bar._otherProps._key.length/tempLevel);
for(var i = 0; i < bar._otherProps._key.length; i++)
{
widthText = getMaxPropertiesText(context,font,bar._otherProps._key[i]).width/scale;
widthRow += widthText + 2 + widthLine;
widthText = getMaxPropertiesText(context,font,bar._otherProps._key[i]).width;
widthRow += (widthText + 2 + widthLine)*scale;
if(!levelKey[level])
levelKey[level] = [];
if(level > tempLevel)
......
......@@ -293,9 +293,9 @@
leftDiff += widthEveryElemKey[n];
}
if(obj._otherProps._key_halign == 'top')
vpos = gVpos + props.height*(i);
vpos = gVpos + props.height*(i)*scale;
else
vpos = gVpos - props.height*(levels.length - i - 1);
vpos = gVpos - props.height*(levels.length - i - 1)*scale;
if (obj._otherProps._key_color_shape == 'line') {
context.beginPath();
context.strokeStyle = colors[elemeNum];
......
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