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

правка для бага #20164

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51188 954022d7-b5bf-4e40-9824-e11837661b57
parent bf003e34
......@@ -1009,6 +1009,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
var formatCellScOy = 'General';
var defaultFormat = 'General';
var isDateTimeFormat;
var catNameFormat;
var api_doc = window["editor"];
var api_sheet = window["Asc"]["editor"];
......@@ -1018,6 +1019,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
arrBaseColors = styleManager.getBaseColors( parseInt(chart.styleId) );
var arrFormatAdobeLabels = [];
var catNameLabels = [];
//просматриваем bShowValue для каждой из серий
//TODO позже отрисовывать значения для каждой серии индивидуально
......@@ -1029,7 +1031,10 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
}
}
}
if(chart.bShowCatName)
chart.bShowValue = true;
if(chart.series && chart.series.length != 0 /*&& !chart.range.intervalObject*/)//берём данные из NumCache
{
isSeries = true;
......@@ -1092,6 +1097,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
skipSeries[l] = false;
arrValues[numSeries] = [];
arrFormatAdobeLabels[numSeries] = [];
catNameLabels[numSeries] = [];
isSkip[numSeries] = true;
var row = firstRow;
......@@ -1160,6 +1166,14 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
else
arrValues[numSeries][n] = value;
arrFormatAdobeLabels[numSeries][n] = formatAdobeLabel;
if(chart.bShowCatName && chart.type != 'Scatter')
{
if(chart.bShowCatName && series[numSeries] && series[numSeries].Cat && chart.type != "Pie")
catNameLabels[numSeries][n] = series[numSeries].Cat.NumCache[col].val;
else if(series[numSeries] && series[numSeries] && series[numSeries].TxCache)
catNameLabels[numSeries][n] = series[numSeries].TxCache.Tx;
}
n++;
}
numSeries++;
......@@ -1321,7 +1335,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
chart.max = max;
if(skipSeries)
chart.skipSeries = skipSeries;
chart.catNameLabels = null;
if(newArr != undefined)
{
chart.arrFormatAdobeLabels = newAdobeLabels;
......@@ -1337,12 +1351,16 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
chart.isSkip = arrReverse(isSkip);
arrValuesRev = arrReverse(arrValues);
chart.arrFormatAdobeLabels = arrReverse(arrFormatAdobeLabels);
if(catNameLabels && catNameLabels.length)
chart.catNameLabels = arrReverse(catNameLabels);
drawChart(chart, arrValuesRev, width, height, options);
}
else
{
chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
if(catNameLabels && catNameLabels.length)
chart.catNameLabels = catNameLabels;
drawChart(chart, arrValues, width, height, options);
}
}
......@@ -1701,6 +1719,10 @@ function drawChart(chart, arrValues, width, height, options) {
else
bar._otherProps._background_image_color = defaultColor;
bar.margins = chart.margins;
if(chart.catNameLabels && chart.catNameLabels.length)
bar.catNameLabels = chart.catNameLabels;
else
bar.catNameLabels = null;
bar.Draw(chart.min,chart.max,chart.ymin,chart.ymax,chart.isSkip,chart.isFormatCell,chart.isformatCellScOy);
}
......
......@@ -1302,7 +1302,10 @@
var formatCellTrue = formatCell;
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[i])
formatCellTrue = this.arrFormatAdobeLabels[i][j];
this.coords.push([startX, startY, individualBarWidth, height, formatCellTrue, this.firstData[i][j]]);
var catName;
if(this.catNameLabels && this.catNameLabels[i] && this.catNameLabels[i][j])
catName = this.catNameLabels[i][j];
this.coords.push([startX, startY, individualBarWidth, height, formatCellTrue, this.firstData[i][j], catName]);
// Facilitate shadows going to the left
if (this._shadow._visible) {
......@@ -2069,7 +2072,10 @@
value = this.coords[i][5];
if(value != '')
value = OfficeExcel.numToFormatText(OfficeExcel.num_round(value),formatCellTrue);
//catName
if(this.catNameLabels && this.coords[i][6])
value = this.coords[i][6];
this.context.fillStyle = this._otherProps._text_color;
OfficeExcel.Text(this.context,
this._otherProps._labels_above_font,
......
......@@ -1388,6 +1388,8 @@
OfficeExcel.num_round = function (num)
{
if(num.toString() && num.toString().indexOf('e+') == -1 && isNaN(parseFloat(num)))
return num;
var floatKoff = 100000000000;
if(num.toString() && num.toString().indexOf('e+') > -1)
{
......
......@@ -993,7 +993,12 @@
//this.context.strokeRect(startX, startY, width, individualBarHeight);
if(width != 0)
this.context.fillRect(startX, startY, width, individualBarHeight);
var catName;
if(this.catNameLabels && this.catNameLabels[i] && this.catNameLabels[i][j])
{
catName = this.catNameLabels[i][j];
}
this.coords.push([startX,
startY,
width,
......@@ -1002,7 +1007,8 @@
this.data[i][j],
true,
this.arrFormatAdobeLabels[i][j],
this.firstData[i][j]
this.firstData[i][j],
catName
]);
}
}
......@@ -1076,14 +1082,16 @@
var formatLabel = format;
if(this.coords[i][7])
formatLabel = this.coords[i][7];
if(this.coords[i][8])
if(this.coords[i][9])
textLabel = this.coords[i][9];
else if(this.coords[i][8])
textLabel = this.coords[i][8];
else
continue;
if(this.coords[i][7] == null && !textLabel)
textLabel = "";
if(textLabel != '')
if(textLabel != '' && !this.coords[i][9])
textLabel = OfficeExcel.numToFormatText(OfficeExcel.num_round(textLabel),formatLabel);
OfficeExcel.Text(this.context,
......
......@@ -1977,11 +1977,19 @@
n = 0;
for (var i = 0; i < this.firstData.length; ++i) {
for (var j = 0; j < this.firstData[i].length; ++j) {
tempData[n] = this.firstData[i][j];
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[i] && this.arrFormatAdobeLabels[i][j])
formatLabels[n] = this.arrFormatAdobeLabels[i][j];
if(this.catNameLabels && this.catNameLabels[i] && this.catNameLabels[i][j])
{
tempData[n] = this.catNameLabels[i][j];
formatLabels[n] = "General";
}
else
formatLabels[n] = format;
{
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++;
}
}
......
......@@ -623,6 +623,7 @@
var labels = this._otherProps._labels;
var context = this.context;
var bold = this._otherProps._labels_above_bold;
var curLabel;
var textOptions =
{
color: this._otherProps._labels_above_color,
......@@ -714,13 +715,19 @@
context.fillStyle = this._otherProps._text_color;
if(this.catNameLabels && typeof this.catNameLabels[0][i] == "string")
{
curLabel = this.catNameLabels[0][i];
isFormatCellTrue = "General";
}
else
curLabel = labels[i];
OfficeExcel.Text(context,
this._otherProps._text_font,
text_size,
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))),
OfficeExcel.numToFormatText(labels[i],isFormatCellTrue),
OfficeExcel.numToFormatText(curLabel,isFormatCellTrue),
vAlignment,
hAlignment, false, null,null, bold, null, textOptions);
}
......
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