Commit a3700098 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Поддержка хидеров серий

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49158 954022d7-b5bf-4e40-9824-e11837661b57
parent 5f48f0e3
...@@ -748,7 +748,7 @@ asc_CChart.prototype = { ...@@ -748,7 +748,7 @@ asc_CChart.prototype = {
// Save old series colors // Save old series colors
var oldSeriaData = []; var oldSeriaData = [];
for ( var i = 0; i < _t.series.length; i++ ) { for ( var i = 0; i < _t.series.length; i++ ) {
oldSeriaData.push( {color: _t.series[i].OutlineColor, seriaTx: _t.series[i].Tx } ); oldSeriaData.push( {color: _t.series[i].OutlineColor, seriaTxCache: _t.series[i].TxCache } );
} }
_t.series = []; _t.series = [];
...@@ -769,6 +769,7 @@ asc_CChart.prototype = { ...@@ -769,6 +769,7 @@ asc_CChart.prototype = {
item.numFormatStr = cell.getNumFormatStr(); item.numFormatStr = cell.getNumFormatStr();
item.isDateTimeFormat = cell.getNumFormat().isDateTimeFormat(); item.isDateTimeFormat = cell.getNumFormat().isDateTimeFormat();
item.value = cell.getValue(); item.value = cell.getValue();
item.isHidden = (_t.range.intervalObject.worksheet._getCol(c1).hd === true) || (_t.range.intervalObject.worksheet._getRow(row).hd === true);
cache.push(item); cache.push(item);
} }
...@@ -781,6 +782,7 @@ asc_CChart.prototype = { ...@@ -781,6 +782,7 @@ asc_CChart.prototype = {
item.numFormatStr = cell.getNumFormatStr(); item.numFormatStr = cell.getNumFormatStr();
item.isDateTimeFormat = cell.getNumFormat().isDateTimeFormat(); item.isDateTimeFormat = cell.getNumFormat().isDateTimeFormat();
item.value = cell.getValue(); item.value = cell.getValue();
item.isHidden = (_t.range.intervalObject.worksheet._getCol(col).hd === true) || (_t.range.intervalObject.worksheet._getRow(r1).hd === true);
cache.push(item); cache.push(item);
} }
...@@ -848,8 +850,14 @@ asc_CChart.prototype = { ...@@ -848,8 +850,14 @@ asc_CChart.prototype = {
ser.xVal.NumCache = getNumCache( bbox.c1 + (parsedHeaders.bLeft ? 1 : 0), bbox.c2, bbox.r1, bbox.r1 ); ser.xVal.NumCache = getNumCache( bbox.c1 + (parsedHeaders.bLeft ? 1 : 0), bbox.c2, bbox.r1, bbox.r1 );
} }
if ( parsedHeaders.bLeft ) {
var formulaCell = new CellAddress(i, bbox.c1 + (parsedHeaders.bLeft ? 1 : 0));
ser.TxCache.Formula = ( !rx_test_ws_name.test(_t.range.intervalObject.worksheet.sName) ? "'" +_t.range.intervalObject.worksheet.sName+ "'" : _t.range.intervalObject.worksheet.sName )
+ "!" + formulaCell.getID();
}
var seriaName = parsedHeaders.bLeft ? ( _t.range.intervalObject.worksheet.getCell(new CellAddress(i, bbox.c1, 0)).getValue() ) : (api.chartTranslate.series + " " + nameIndex); var seriaName = parsedHeaders.bLeft ? ( _t.range.intervalObject.worksheet.getCell(new CellAddress(i, bbox.c1, 0)).getValue() ) : (api.chartTranslate.series + " " + nameIndex);
ser.Tx = seriaName; ser.TxCache.Tx = seriaName;
_t.series.push(ser); _t.series.push(ser);
nameIndex++; nameIndex++;
} }
...@@ -883,8 +891,14 @@ asc_CChart.prototype = { ...@@ -883,8 +891,14 @@ asc_CChart.prototype = {
ser.xVal.NumCache = getNumCache( bbox.c1, bbox.c1, bbox.r1 + (parsedHeaders.bTop ? 1 : 0), bbox.r2 ); ser.xVal.NumCache = getNumCache( bbox.c1, bbox.c1, bbox.r1 + (parsedHeaders.bTop ? 1 : 0), bbox.r2 );
} }
if ( parsedHeaders.bTop ) {
var formulaCell = new CellAddress(bbox.r1 + (parsedHeaders.bTop ? 1 : 0), i);
ser.TxCache.Formula = ( !rx_test_ws_name.test(_t.range.intervalObject.worksheet.sName) ? "'" +_t.range.intervalObject.worksheet.sName+ "'" : _t.range.intervalObject.worksheet.sName )
+ "!" + formulaCell.getID();
}
var seriaName = parsedHeaders.bTop ? ( _t.range.intervalObject.worksheet.getCell(new CellAddress(bbox.r1, i, 0)).getValue() ) : (api.chartTranslate.series + " " + nameIndex); var seriaName = parsedHeaders.bTop ? ( _t.range.intervalObject.worksheet.getCell(new CellAddress(bbox.r1, i, 0)).getValue() ) : (api.chartTranslate.series + " " + nameIndex);
ser.Tx = seriaName; ser.TxCache.Tx = seriaName;
_t.series.push(ser); _t.series.push(ser);
nameIndex++; nameIndex++;
} }
...@@ -901,7 +915,8 @@ asc_CChart.prototype = { ...@@ -901,7 +915,8 @@ asc_CChart.prototype = {
if ( i < oldSeriaData.length ) { if ( i < oldSeriaData.length ) {
_t.series[i].OutlineColor = oldSeriaData[i].color; _t.series[i].OutlineColor = oldSeriaData[i].color;
_t.series[i].Tx = oldSeriaData[i].seriaTx; _t.series[i].TxCache.Tx = oldSeriaData[i].seriaTxCache.Tx;
_t.series[i].TxCache.Formula = oldSeriaData[i].seriaTxCache.Formula;
} }
else else
_t.series[i].OutlineColor = seriaUniColors[i]; _t.series[i].OutlineColor = seriaUniColors[i];
...@@ -1651,7 +1666,6 @@ prot["asc_setUnderline"] = prot.asc_setUnderline; ...@@ -1651,7 +1666,6 @@ prot["asc_setUnderline"] = prot.asc_setUnderline;
function asc_CChartSeria() { function asc_CChartSeria() {
this.Val = { Formula: null, NumCache: [] }; this.Val = { Formula: null, NumCache: [] };
this.xVal = { Formula: null, NumCache: [] }; this.xVal = { Formula: null, NumCache: [] };
this.Tx = null; // пока оставил
this.TxCache = { Formula: null, Tx: null }; this.TxCache = { Formula: null, Tx: null };
this.Marker = { Size: null, Symbol: null }; this.Marker = { Size: null, Symbol: null };
this.OutlineColor = null; this.OutlineColor = null;
......
...@@ -1799,11 +1799,11 @@ function drawChart(chart, arrValues, width, height) { ...@@ -1799,11 +1799,11 @@ function drawChart(chart, arrValues, width, height) {
colorMap = GenerateDefaultColorMap().color_map; colorMap = GenerateDefaultColorMap().color_map;
} }
if(chart.series && chart.series.length != 0 && (chart.series[0].Tx || chart.series[0].OutlineColor) && (theme && colorMap)) if(chart.series && chart.series.length != 0 && (chart.series[0].TxCache.Tx || chart.series[0].OutlineColor) && (theme && colorMap))
{ {
for (var j = 0; j < chart.series.length; j++) { for (var j = 0; j < chart.series.length; j++) {
if(chart.series[j].Tx) if(chart.series[j].TxCache.Tx)
bar._otherProps._key[j] = chart.series[j].Tx; bar._otherProps._key[j] = chart.series[j].TxCache.Tx;
if(chart.series[j].OutlineColor) if(chart.series[j].OutlineColor)
{ {
chart.series[j].OutlineColor.Calculate(theme, colorMap, RGBA); chart.series[j].OutlineColor.Calculate(theme, colorMap, RGBA);
...@@ -1813,9 +1813,9 @@ function drawChart(chart, arrValues, width, height) { ...@@ -1813,9 +1813,9 @@ function drawChart(chart, arrValues, width, height) {
} }
} }
} }
if((chart.series && chart.series[0]) && (chart.series[0].Tx || chart.series[0].OutlineColor)) if((chart.series && chart.series[0]) && (chart.series[0].TxCache.Tx || chart.series[0].OutlineColor))
{ {
if(!chart.series[0].Tx) if(!chart.series[0].TxCache.Tx)
{ {
for (var j = 0; j < legendCnt; j++) { for (var j = 0; j < legendCnt; j++) {
bar._otherProps._key[j] = 'Series' + (j + 1); bar._otherProps._key[j] = 'Series' + (j + 1);
......
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