Commit d88f7638 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@49087 954022d7-b5bf-4e40-9824-e11837661b57
parent 017eb504
......@@ -1578,8 +1578,8 @@ function drawChart(chart, arrValues, width, height) {
if((!chart.header.title || chart.header.title == null || chart.header.title == undefined || chart.header.title == '') && chart.header.bDefaultTitle)
chart.header.title = defaultTitle;
// Легенда
if (chart.legend.bShow && chart.legend.position != '') {
// *****Легенда******
bar._otherProps._key_position = 'graph';
bar._otherProps._key = [];
bar._otherProps._key_halign = chart.legend.position;
......@@ -1592,20 +1592,40 @@ function drawChart(chart, arrValues, width, height) {
if(chart.type == "Stock")
legendCnt = 4;
//если есть объект series
if(chart.series && chart.series.length != 0 && (chart.series[0].Tx || chart.series[0].OutlineColor) )
var theme;
var colorMap;
var RGBA;
if(api_sheet && chart.worksheet)
{
var wb = api_sheet.wbModel;
theme = wb.theme;
colorMap = GenerateDefaultColorMap().color_map;
RGBA = {R: 0, G: 0, B: 0, A: 255};
}
else if(api_doc)
{
theme = api.WordControl.m_oLogicDocument.theme;
colorMap = api.WordControl.m_oLogicDocument.clrSchemeMap.color_map;
RGBA = {R: 0, G: 0, B: 0, A: 255};
if(colorMap==null)
colorMap = GenerateDefaultColorMap().color_map;
}
if(chart.series && chart.series.length != 0 && (chart.series[0].Tx || chart.series[0].OutlineColor) && (theme && colorMap))
{
for (var j = 0; j < chart.series.length; j++) {
if(chart.series[j].Tx)
bar._otherProps._key[j] = chart.series[j].Tx;
if(chart.series[j].OutlineColor && chart.series[j].OutlineColor.color.RGBA)
if(chart.series[j].OutlineColor)
{
rgba = chart.series[j].OutlineColor.color.RGBA;
chart.series[j].OutlineColor.Calculate(theme, colorMap, RGBA);
rgba = chart.series[j].OutlineColor.RGBA;
curColor = getHexColor(rgba.R, rgba.G, rgba.B);
bar._otherProps._colors[j] = curColor;
}
}
}
if(!chart.series[0].Tx || !chart.series[0].OutlineColor)
if((chart.series && chart.series[0]) && (chart.series[0].Tx || chart.series[0].OutlineColor))
{
if(!chart.series[0].Tx)
{
......@@ -1643,11 +1663,12 @@ function drawChart(chart, arrValues, width, height) {
}
}
}
else{
bar._otherProps._key_halign = 'none';
if (!chart.legend.bShow || chart.legend.position == '')
{
bar._otherProps._key = [];
bar._otherProps._key_halign = 'none';
}
//в случае наличия скрытых строчек или столбов(в итоге скрытых серий)
if(chart.skipSeries)
{
......
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