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
This diff is collapsed.
......@@ -1345,14 +1345,16 @@
if (this.data[i][j] < 0) {
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;
OfficeExcel.Text(this.context,
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),
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.numToFormatText(OfficeExcel.num_round(this.data[i][j]),formatCell),
OfficeExcel.numToFormatText(OfficeExcel.num_round(this.firstData[i][j]),formatCellTrue),
null,
this._otherProps._labels_above_angle ? (this._otherProps._labels_above_angle > 0 ? 'right' : 'left') : 'center',
null,
......
......@@ -1027,7 +1027,10 @@
individualBarHeight,
this.context.fillStyle,
this.data[i][j],
true]);
true,
this.arrFormatAdobeLabels[i][j],
this.firstData[i][j]
]);
}
}
......@@ -1096,6 +1099,12 @@
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 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,
font,
......@@ -1103,7 +1112,7 @@
coords[i][0] + coords[i][2] + (border ? -5 : 5),
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.numToFormatText(OfficeExcel.num_round(this.coords[i][5]),format),
OfficeExcel.numToFormatText(OfficeExcel.num_round(textLabel),formatLabel),
'center',
border ? 'right' : 'left',
null,
......
......@@ -2014,16 +2014,22 @@
italic: this._otherProps._labels_above_italic
}
context.beginPath();
var formatLabels = [];
var tempData = [];
n = 0;
for (var i = 0; i < this.data.length; ++i) {
for (var j = 0; j < this.data[i].length; ++j) {
tempData[n++] = this.data[i][j]
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];
else
formatLabels[n] = format;
n++;
}
}
for (var i = 0; i < this.coords.length; ++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)');
}
......
......@@ -665,7 +665,9 @@
var text_size = this._otherProps._text_size;
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
*/
......@@ -729,7 +731,7 @@
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.centery + explosion_offsety + (((this.radius + 10) * Math.sin(a))),
OfficeExcel.numToFormatText(labels[i],isFormatCell),
OfficeExcel.numToFormatText(labels[i],isFormatCellTrue),
vAlignment,
hAlignment, false, null,null, bold, null, textOptions);
}
......
......@@ -1880,7 +1880,9 @@
var x_val = this.data[_set][point][0];
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 y_pos = this.coords[_set][point][1];
......@@ -1891,7 +1893,7 @@
x_pos,
y_pos - 5 - size,
//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',
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