Commit 41983b4e 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@47957 954022d7-b5bf-4e40-9824-e11837661b57
parent c45a74b8
...@@ -695,6 +695,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -695,6 +695,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
var styleManager = api_doc ? api_doc.chartStyleManager : api_sheet.chartStyleManager; var styleManager = api_doc ? api_doc.chartStyleManager : api_sheet.chartStyleManager;
arrBaseColors = styleManager.getBaseColors( parseInt(chart.styleId) ); arrBaseColors = styleManager.getBaseColors( parseInt(chart.styleId) );
var arrFormatAdobeLabels = [];
if(chart.series && chart.series.length !=0 && api_sheet) if(chart.series && chart.series.length !=0 && api_sheet)
{ {
isSeries = true; isSeries = true;
...@@ -720,6 +721,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -720,6 +721,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
var n = 0; var n = 0;
arrValues[l] = []; arrValues[l] = [];
arrFormatAdobeLabels[l] = [];
var formula = formulaToRange(series[l].Val.Formula,ws); var formula = formulaToRange(series[l].Val.Formula,ws);
var xFormula = formulaToRange(series[l].xVal.Formula,ws); var xFormula = formulaToRange(series[l].xVal.Formula,ws);
...@@ -743,6 +745,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -743,6 +745,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
for(col = xfirstCol; col <= xlastCol; ++col) for(col = xfirstCol; col <= xlastCol; ++col)
{ {
arrValues[l][n] = []; arrValues[l][n] = [];
arrFormatAdobeLabels[l][n] = [];
var cell = ws.getCell(new CellAddress(row - 1, col - 1, 0)); var cell = ws.getCell(new CellAddress(row - 1, col - 1, 0));
var cellY = ws.getCell(new CellAddress(firstRow - 1, firstCol + n - 1, 0)); var cellY = ws.getCell(new CellAddress(firstRow - 1, firstCol + n - 1, 0));
...@@ -777,6 +780,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -777,6 +780,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
else else
arrValues[l][n][1] = valueY; arrValues[l][n][1] = valueY;
arrFormatAdobeLabels[l][n][0] = cell.getNumFormatStr();
arrFormatAdobeLabels[l][n][1] = cellY.getNumFormatStr();
if(value.toString() != '' && !isEn) if(value.toString() != '' && !isEn)
{ {
min = value; min = value;
...@@ -808,6 +814,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -808,6 +814,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
for(row = xfirstRow; row <= xlastRow; ++row) for(row = xfirstRow; row <= xlastRow; ++row)
{ {
arrValues[l][n] = []; arrValues[l][n] = [];
arrFormatAdobeLabels[l][n] = [];
var cell = ws.getCell(new CellAddress(row - 1, col - 1, 0)); var cell = ws.getCell(new CellAddress(row - 1, col - 1, 0));
var cellY = ws.getCell(new CellAddress(firstRow + n - 1, firstCol - 1, 0)); var cellY = ws.getCell(new CellAddress(firstRow + n - 1, firstCol - 1, 0));
...@@ -837,6 +844,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -837,6 +844,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
else else
arrValues[l][n][1] = valueY; arrValues[l][n][1] = valueY;
arrFormatAdobeLabels[l][n][0] = cell.getNumFormatStr();
arrFormatAdobeLabels[l][n][1] = cellY.getNumFormatStr();
if(value.toString() != '' && !isEn) if(value.toString() != '' && !isEn)
{ {
min = value; min = value;
...@@ -895,6 +905,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -895,6 +905,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
} }
skipSeries[l] = false; skipSeries[l] = false;
arrValues[numSeries] = []; arrValues[numSeries] = [];
arrFormatAdobeLabels[numSeries] = [];
isSkip[numSeries] = true; isSkip[numSeries] = true;
if(!isRow)//по строкам или по столбцам if(!isRow)//по строкам или по столбцам
...@@ -926,6 +937,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -926,6 +937,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
formatCellScOy = cell.getNumFormatStr(); formatCellScOy = cell.getNumFormatStr();
} }
formatAdobeLabel = cell.getNumFormatStr();
var orValue = cell.getValue(); var orValue = cell.getValue();
if('' != orValue) if('' != orValue)
...@@ -951,6 +963,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -951,6 +963,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
arrValues[numSeries][n] = Math.abs(value); arrValues[numSeries][n] = Math.abs(value);
else else
arrValues[numSeries][n] = value; arrValues[numSeries][n] = value;
arrFormatAdobeLabels[numSeries][n] = formatAdobeLabel;
n++; n++;
} }
} }
...@@ -986,6 +999,8 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -986,6 +999,8 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
var orValue = cell.getValue(); var orValue = cell.getValue();
if('' != orValue) if('' != orValue)
isSkip[numSeries] = false; isSkip[numSeries] = false;
formatAdobeLabel = cell.getNumFormatStr();
var value = parseFloat(orValue) var value = parseFloat(orValue)
if(!isEn && !isNaN(value)) if(!isEn && !isNaN(value))
{ {
...@@ -1008,7 +1023,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1008,7 +1023,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
arrValues[numSeries][n] = Math.abs(value); arrValues[numSeries][n] = Math.abs(value);
else else
arrValues[numSeries][n] = value; arrValues[numSeries][n] = value;
arrFormatAdobeLabels[numSeries][n] = formatAdobeLabel;
n++; n++;
} }
} }
...@@ -1029,6 +1044,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1029,6 +1044,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
var isSkipRev = []; var isSkipRev = [];
for (row = 0; row < data.length; ++row) { for (row = 0; row < data.length; ++row) {
arrValues[n] = []; arrValues[n] = [];
arrFormatAdobeLabels[n] = [];
var k = 0; var k = 0;
isSkip[row] = true; isSkip[row] = true;
for (col = 0; col < data[row].length; ++col) { for (col = 0; col < data[row].length; ++col) {
...@@ -1050,6 +1066,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1050,6 +1066,9 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
formatCellScOy = data[row][col].numFormatStr; formatCellScOy = data[row][col].numFormatStr;
var orValue = data[row][col].value; var orValue = data[row][col].value;
var formatAdobeLabel = 'General';
if(data[row][col].numFormatStr)
formatAdobeLabel = data[row][col].numFormatStr;
var value = parseFloat(orValue); var value = parseFloat(orValue);
//если все значения пустые, то в дальнейшем при отрисовке пропускаем //если все значения пустые, то в дальнейшем при отрисовке пропускаем
if(!isNaN(parseFloat(orValue))) if(!isNaN(parseFloat(orValue)))
...@@ -1074,6 +1093,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1074,6 +1093,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
arrValues[n][k] = Math.abs(value); arrValues[n][k] = Math.abs(value);
else else
arrValues[n][k] = value; arrValues[n][k] = value;
arrFormatAdobeLabels[n][k] = formatAdobeLabel;
k++; k++;
} }
n++; n++;
...@@ -1171,7 +1191,11 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1171,7 +1191,11 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
} }
if(isSeries) if(isSeries)
{
var arrFormatAdobeLabelsRev = arrFormatAdobeLabels;
var arrValuesRev = arrValues; var arrValuesRev = arrValues;
}
isEn = false; isEn = false;
if(chart.type == 'Scatter' && !newArr) if(chart.type == 'Scatter' && !newArr)
{ {
...@@ -1279,7 +1303,11 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1279,7 +1303,11 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
chart.ymax = maxY; chart.ymax = maxY;
} }
if(!arrValuesRev) if(!arrValuesRev)
arrValuesRev = arrReverse(arrValues) arrValuesRev = arrReverse(arrValues);
if(!arrFormatAdobeLabelsRev)
arrFormatAdobeLabelsRev = arrReverse(arrFormatAdobeLabels);
//if ((bbox.c2 - bbox.c1) < bbox.r2 - bbox.r1) //if ((bbox.c2 - bbox.c1) < bbox.r2 - bbox.r1)
chart.isFormatCell = formatCell; chart.isFormatCell = formatCell;
chart.isformatCellScOy = formatCellScOy; chart.isformatCellScOy = formatCellScOy;
...@@ -1298,24 +1326,29 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1298,24 +1326,29 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
{ {
//надо перевернуть массив //надо перевернуть массив
arrValuesRev = arrReverse(arrValues); arrValuesRev = arrReverse(arrValues);
chart.arrFormatAdobeLabels = arrReverse(arrFormatAdobeLabels);
drawChart(chart, arrValuesRev, width, height); drawChart(chart, arrValuesRev, width, height);
} }
else else
{
chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
drawChart(chart, arrValues, width, height); drawChart(chart, arrValues, width, height);
} }
}
else else
{ {
if (chart.range.rows) if (chart.range.rows)
{ {
if(chart.type == 'HBar' || chart.type == 'Bar' || chart.type == 'Stock') if(chart.type == 'HBar' || chart.type == 'Bar' || chart.type == 'Stock')
{ {
//chart.isSkip = isSkipRev;
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev;
drawChart(chart, arrValuesRev, width, height); drawChart(chart, arrValuesRev, width, height);
} }
else else
{ {
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
drawChart(chart, arrValues, width, height); drawChart(chart, arrValues, width, height);
} }
} }
...@@ -1324,12 +1357,14 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) { ...@@ -1324,12 +1357,14 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart) {
if(chart.type == 'HBar' || chart.type == 'Bar' || chart.type == 'Stock') if(chart.type == 'HBar' || chart.type == 'Bar' || chart.type == 'Stock')
{ {
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
drawChart(chart, arrValues, width, height); drawChart(chart, arrValues, width, height);
} }
else else
{ {
//chart.isSkip = isSkipRev; //chart.isSkip = isSkipRev;
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev;
drawChart(chart, arrValuesRev, width, height); drawChart(chart, arrValuesRev, width, height);
} }
} }
...@@ -1401,7 +1436,7 @@ function drawChart(chart, arrValues, width, height) { ...@@ -1401,7 +1436,7 @@ function drawChart(chart, arrValues, width, height) {
var lengthOfSeries; var lengthOfSeries;
if(chart.series && chart.series.length != 0) if(chart.series && chart.series.length != 0 && window["Asc"]["editor"])
{ {
lengthOfSeries = chart.series.length; lengthOfSeries = chart.series.length;
} }
...@@ -1554,6 +1589,7 @@ function drawChart(chart, arrValues, width, height) { ...@@ -1554,6 +1589,7 @@ function drawChart(chart, arrValues, width, height) {
bar._yAxisTitle._vpos = bar._chartGutter._top + (bar.canvas.height - bar._chartGutter._top - bar._chartGutter._bottom) / 2 ; bar._yAxisTitle._vpos = bar._chartGutter._top + (bar.canvas.height - bar._chartGutter._top - bar._chartGutter._bottom) / 2 ;
bar._yAxisTitle._hpos = 23 + keyLeft; bar._yAxisTitle._hpos = 23 + keyLeft;
} }
bar.arrFormatAdobeLabels = chart.arrFormatAdobeLabels;
//выставляем параметры текса //выставляем параметры текса
setFontChart(chart); setFontChart(chart);
calcAllMargin(chart.isFormatCell,chart.isformatCellScOy,chart.min,chart.max,chart.ymin,chart.ymax, chart); calcAllMargin(chart.isFormatCell,chart.isformatCellScOy,chart.min,chart.max,chart.ymin,chart.ymax, chart);
...@@ -1714,7 +1750,6 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) { ...@@ -1714,7 +1750,6 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) {
var copyData = $.extend(true, [], data); var copyData = $.extend(true, [], data);
bar = new OfficeExcel.Line(chartCanvas, data); bar = new OfficeExcel.Line(chartCanvas, data);
bar.firstData = copyData;
bar._otherProps._autoGrouping = chartType; bar._otherProps._autoGrouping = chartType;
//в случае поверхностной диаграммы //в случае поверхностной диаграммы
...@@ -1758,6 +1793,12 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) { ...@@ -1758,6 +1793,12 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) {
bar.original_data = tempData; bar.original_data = tempData;
} }
if((bar._otherProps._autoGrouping == 'stacked' || bar._otherProps._autoGrouping == 'stackedPer') && bar._otherProps._filled)
{
copyData = OfficeExcel.array_reverse(copyData);
chart.arrFormatAdobeLabels = OfficeExcel.array_reverse(chart.arrFormatAdobeLabels);
}
bar.newData = data; bar.newData = data;
bar.firstData = copyData; bar.firstData = copyData;
...@@ -1818,6 +1859,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) { ...@@ -1818,6 +1859,8 @@ function DrawLineChart(chartCanvas, chartType, chartSubType, data, chart) {
function DrawBarChart(chartCanvas, chartSubType, data, chart) { function DrawBarChart(chartCanvas, chartSubType, data, chart) {
bar = new OfficeExcel.Bar(chartCanvas, data); bar = new OfficeExcel.Bar(chartCanvas, data);
var copyData = $.extend(true, [], data);
bar.firstData = copyData;
//меняем входные данные для нормированной диаграммы //меняем входные данные для нормированной диаграммы
bar._otherProps._autoGrouping = chartSubType; bar._otherProps._autoGrouping = chartSubType;
//с накоплениями //с накоплениями
...@@ -1881,10 +1924,13 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) { ...@@ -1881,10 +1924,13 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) {
} }
data = OfficeExcel.array_reverse(data); data = OfficeExcel.array_reverse(data);
var copyData = $.extend(true, [], data);
bar = new OfficeExcel.HBar(chartCanvas, data); bar = new OfficeExcel.HBar(chartCanvas, data);
bar._otherProps._autoGrouping = chartSubType; bar._otherProps._autoGrouping = chartSubType;
var originalData = $.extend(true, [], data); var originalData = $.extend(true, [], data);
chart.arrFormatAdobeLabels = OfficeExcel.array_reverse(chart.arrFormatAdobeLabels);
if (bar._otherProps._autoGrouping == 'stacked') { if (bar._otherProps._autoGrouping == 'stacked') {
for (var j = 0; j < (data.length); j++) { for (var j = 0; j < (data.length); j++) {
...@@ -1892,6 +1938,8 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) { ...@@ -1892,6 +1938,8 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) {
data[j][i] = findPrevValue(originalData, j, i) data[j][i] = findPrevValue(originalData, j, i)
} }
data[j] = OfficeExcel.array_reverse(data[j]); data[j] = OfficeExcel.array_reverse(data[j]);
copyData[j] = OfficeExcel.array_reverse(copyData[j]);
chart.arrFormatAdobeLabels[j] = OfficeExcel.array_reverse(chart.arrFormatAdobeLabels[j]);
} }
bar.original_data = data; bar.original_data = data;
} }
...@@ -1922,10 +1970,20 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) { ...@@ -1922,10 +1970,20 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) {
tempData[j][i] = 0; tempData[j][i] = 0;
} }
tempData[j] = OfficeExcel.array_reverse(tempData[j]); tempData[j] = OfficeExcel.array_reverse(tempData[j]);
copyData[j] = OfficeExcel.array_reverse(copyData[j]);
chart.arrFormatAdobeLabels[j] = OfficeExcel.array_reverse(chart.arrFormatAdobeLabels[j]);
} }
bar.data = tempData; bar.data = tempData;
bar.original_data = tempData; bar.original_data = tempData;
} }
else
{
for (var j = 0; j < (copyData.length); j++) {
chart.arrFormatAdobeLabels[j] = OfficeExcel.array_reverse(chart.arrFormatAdobeLabels[j]);
}
}
bar.firstData = copyData;
//bar._otherProps._labels = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']; //bar._otherProps._labels = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];
bar._otherProps._area_border = chart.bShowBorder; bar._otherProps._area_border = chart.bShowBorder;
......
...@@ -1345,14 +1345,16 @@ ...@@ -1345,14 +1345,16 @@
if (this.data[i][j] < 0) { if (this.data[i][j] < 0) {
yPos += height + 6 + (this._otherProps._text_size - 4); yPos += height + 6 + (this._otherProps._text_size - 4);
} }
var formatCellTrue = formatCell;
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[i] && this.arrFormatAdobeLabels[i][j])
formatCellTrue = this.arrFormatAdobeLabels[i][j];
this.context.fillStyle = this._otherProps._text_color; this.context.fillStyle = this._otherProps._text_color;
OfficeExcel.Text(this.context, OfficeExcel.Text(this.context,
this._otherProps._labels_above_font, this._otherProps._labels_above_font,
typeof(this._otherProps._labels_above_size) == 'number' ? this._otherProps._labels_above_size : this._otherProps._text_size - 3,startX + (individualBarWidth / 2), typeof(this._otherProps._labels_above_size) == 'number' ? this._otherProps._labels_above_size : this._otherProps._text_size - 3,startX + (individualBarWidth / 2),
startY - 2 - (this._otherProps._variant == '3d' ? 5 : 0), startY - 2 - (this._otherProps._variant == '3d' ? 5 : 0),
//OfficeExcel.number_format(this, OfficeExcel.num_round(this.data[i][j]),this._otherProps._units_pre,this._otherProps._units_post), //OfficeExcel.number_format(this, OfficeExcel.num_round(this.data[i][j]),this._otherProps._units_pre,this._otherProps._units_post),
OfficeExcel.numToFormatText(OfficeExcel.num_round(this.data[i][j]),formatCell), OfficeExcel.numToFormatText(OfficeExcel.num_round(this.firstData[i][j]),formatCellTrue),
null, null,
this._otherProps._labels_above_angle ? (this._otherProps._labels_above_angle > 0 ? 'right' : 'left') : 'center', this._otherProps._labels_above_angle ? (this._otherProps._labels_above_angle > 0 ? 'right' : 'left') : 'center',
null, null,
......
...@@ -1027,7 +1027,10 @@ ...@@ -1027,7 +1027,10 @@
individualBarHeight, individualBarHeight,
this.context.fillStyle, this.context.fillStyle,
this.data[i][j], this.data[i][j],
true]); true,
this.arrFormatAdobeLabels[i][j],
this.firstData[i][j]
]);
} }
} }
...@@ -1096,6 +1099,12 @@ ...@@ -1096,6 +1099,12 @@
OfficeExcel.NoShadow(this); OfficeExcel.NoShadow(this);
var border = (coords[i][0] + coords[i][2] + 7 + this.context.measureText(this._otherProps._units_pre + this.coords[i][5] + this._otherProps._units_post).width) > OfficeExcel.GetWidth(this) ? true : false; var border = (coords[i][0] + coords[i][2] + 7 + this.context.measureText(this._otherProps._units_pre + this.coords[i][5] + this._otherProps._units_post).width) > OfficeExcel.GetWidth(this) ? true : false;
var textLabel = this.coords[i][5];
var formatLabel = format;
if(this.coords[i][7])
formatLabel = this.coords[i][7];
if(this.coords[i][8])
textLabel = this.coords[i][8];
OfficeExcel.Text(this.context, OfficeExcel.Text(this.context,
font, font,
...@@ -1103,7 +1112,7 @@ ...@@ -1103,7 +1112,7 @@
coords[i][0] + coords[i][2] + (border ? -5 : 5), coords[i][0] + coords[i][2] + (border ? -5 : 5),
coords[i][1] + (coords[i][3] / 2), coords[i][1] + (coords[i][3] / 2),
//OfficeExcel.number_format(this, OfficeExcel.num_round(this.coords[i][5]), this._otherProps._units_pre, this._otherProps._units_post), //OfficeExcel.number_format(this, OfficeExcel.num_round(this.coords[i][5]), this._otherProps._units_pre, this._otherProps._units_post),
OfficeExcel.numToFormatText(OfficeExcel.num_round(this.coords[i][5]),format), OfficeExcel.numToFormatText(OfficeExcel.num_round(textLabel),formatLabel),
'center', 'center',
border ? 'right' : 'left', border ? 'right' : 'left',
null, null,
......
...@@ -2014,16 +2014,22 @@ ...@@ -2014,16 +2014,22 @@
italic: this._otherProps._labels_above_italic italic: this._otherProps._labels_above_italic
} }
context.beginPath(); context.beginPath();
var formatLabels = [];
var tempData = []; var tempData = [];
n = 0; n = 0;
for (var i = 0; i < this.data.length; ++i) { for (var i = 0; i < this.firstData.length; ++i) {
for (var j = 0; j < this.data[i].length; ++j) { for (var j = 0; j < this.firstData[i].length; ++j) {
tempData[n++] = this.data[i][j] tempData[n] = this.firstData[i][j];
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[i] && this.arrFormatAdobeLabels[i][j])
formatLabels[n] = this.arrFormatAdobeLabels[i][j];
else
formatLabels[n] = format;
n++;
} }
} }
for (var i = 0; i < this.coords.length; ++i) { for (var i = 0; i < this.coords.length; ++i) {
var coords = this.coords[i]; var coords = this.coords[i];
OfficeExcel.Text(context, font, size, coords[0], coords[1] - 5 - size,OfficeExcel.numToFormatText( OfficeExcel.num_round(tempData[i]),format), 'center', 'center', false, null, 'rgba(255, 255, 255, 0.7)', bold, null, textOptions); OfficeExcel.Text(context, font, size, coords[0], coords[1] - 5 - size,OfficeExcel.numToFormatText( OfficeExcel.num_round(tempData[i]),formatLabels[i]), 'center', 'center', false, null, 'rgba(255, 255, 255, 0.7)', bold, null, textOptions);
// OfficeExcel.Text(context, font, size, coords[0], coords[1] - 5 - size, OfficeExcel.number_format(this, OfficeExcel.num_round(tempData[i]), units_pre, units_post), 'center', 'center', false, null, 'rgba(255, 255, 255, 0.7)'); // OfficeExcel.Text(context, font, size, coords[0], coords[1] - 5 - size, OfficeExcel.number_format(this, OfficeExcel.num_round(tempData[i]), units_pre, units_post), 'center', 'center', false, null, 'rgba(255, 255, 255, 0.7)');
} }
......
...@@ -665,7 +665,9 @@ ...@@ -665,7 +665,9 @@
var text_size = this._otherProps._text_size; var text_size = this._otherProps._text_size;
for (i=0; i<labels.length; ++i) { for (i=0; i<labels.length; ++i) {
isFormatCellTrue = isFormatCell;
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[i])
isFormatCellTrue = this.arrFormatAdobeLabels[0][i];
/** /**
* T|his ensures that if we're given too many labels, that we don't get an error * T|his ensures that if we're given too many labels, that we don't get an error
*/ */
...@@ -729,7 +731,7 @@ ...@@ -729,7 +731,7 @@
text_size, text_size,
this.centerx + explosion_offsetx + ((this.radius + 10)* Math.cos(a)) + (this._otherProps._labels_sticks ? (a < 1.57 || a > 4.71 ? 2 : -2) : 0), this.centerx + explosion_offsetx + ((this.radius + 10)* Math.cos(a)) + (this._otherProps._labels_sticks ? (a < 1.57 || a > 4.71 ? 2 : -2) : 0),
this.centery + explosion_offsety + (((this.radius + 10) * Math.sin(a))), this.centery + explosion_offsety + (((this.radius + 10) * Math.sin(a))),
OfficeExcel.numToFormatText(labels[i],isFormatCell), OfficeExcel.numToFormatText(labels[i],isFormatCellTrue),
vAlignment, vAlignment,
hAlignment, false, null,null, bold, null, textOptions); hAlignment, false, null,null, bold, null, textOptions);
} }
......
...@@ -1880,7 +1880,9 @@ ...@@ -1880,7 +1880,9 @@
var x_val = this.data[_set][point][0]; var x_val = this.data[_set][point][0];
var y_val = this.data[_set][point][1]; var y_val = this.data[_set][point][1];
var formatTrue = format;
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[_set] && this.arrFormatAdobeLabels[_set][point] && this.arrFormatAdobeLabels[_set][point][1])
formatTrue = this.arrFormatAdobeLabels[_set][point][1];
var x_pos = this.coords[_set][point][0]; var x_pos = this.coords[_set][point][0];
var y_pos = this.coords[_set][point][1]; var y_pos = this.coords[_set][point][1];
...@@ -1891,7 +1893,7 @@ ...@@ -1891,7 +1893,7 @@
x_pos, x_pos,
y_pos - 5 - size, y_pos - 5 - size,
//x_val.toFixed(this._otherProps._labels_above_decimals) + ', ' + y_val.toFixed(this._otherProps._labels_above_decimals), //x_val.toFixed(this._otherProps._labels_above_decimals) + ', ' + y_val.toFixed(this._otherProps._labels_above_decimals),
OfficeExcel.numToFormatText(OfficeExcel.num_round(y_val),format), OfficeExcel.numToFormatText(OfficeExcel.num_round(y_val),formatTrue),
'center', 'center',
'center', 'center',
false,//ðàìêà false,//ðàìêà
......
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