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 @@ ...@@ -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,14 +1099,20 @@ ...@@ -1096,14 +1099,20 @@
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,
size, size,
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