Commit 2b8599f0 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@48000 954022d7-b5bf-4e40-9824-e11837661b57
parent d79cd6e0
...@@ -1786,6 +1786,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) { ...@@ -1786,6 +1786,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) {
data[j + 1][i] = data[j + 1][i] + data[j][i] data[j + 1][i] = data[j + 1][i] + data[j][i]
} }
} }
chart.max = getMaxValueArray(data);
chart.min = getMinValueArray(data);
bar.original_data = data; bar.original_data = data;
} }
else if (bar._otherProps._autoGrouping == 'stackedPer') { else if (bar._otherProps._autoGrouping == 'stackedPer') {
...@@ -1812,6 +1814,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) { ...@@ -1812,6 +1814,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) {
tempData[i][j] = (100 * tempData[i][j]) / (summValue[j]); tempData[i][j] = (100 * tempData[i][j]) / (summValue[j]);
} }
} }
chart.max = getMaxValueArray(tempData);
chart.min = getMinValueArray(tempData);
bar.data = tempData; bar.data = tempData;
bar.original_data = tempData; bar.original_data = tempData;
} }
...@@ -2377,3 +2381,34 @@ function getMaxPropertiesText(context, font, text) ...@@ -2377,3 +2381,34 @@ function getMaxPropertiesText(context, font, text)
} }
return result; return result;
} }
function getMaxValueArray(array)
{
var max = 0;
for(var i = 0; i < array.length; i++)
{
for(var j = 0; j < array[i].length; j++)
{
if(i == 0 && j == 0)
max = array[i][j];
if(array[i][j] > max)
max = array[i][j];
}
}
return max;
}
function getMinValueArray(array)
{
var min = 0;
for(var i = 0; i < array.length; i++)
{
for(var j = 0; j < array[i].length; j++)
{
if(i == 0 && j == 0)
min = array[i][j];
if(array[i][j] < min)
min = array[i][j];
}
}
return min;
}
\ No newline at end of file
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