Commit 4b4651a0 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

delete _labels_sticks

delete _xscale_formatter
delete DrawSticks (pie)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51859 954022d7-b5bf-4e40-9824-e11837661b57
parent 9fe0711f
...@@ -86,9 +86,6 @@ OfficeExcel.OtherProps = function() ...@@ -86,9 +86,6 @@ OfficeExcel.OtherProps = function()
this._labels_above = false; this._labels_above = false;
this._labels_above_size = null; this._labels_above_size = null;
this._labels_above_angle = null; this._labels_above_angle = null;
this._labels_sticks = false;
this._labels_sticks_length = 7;
this._labels_sticks_color = '#aaa';
this._labels_specific_align = 'left'; this._labels_specific_align = 'left';
this._background_barcolor1 = 'rgba(0,0,0,0)'; this._background_barcolor1 = 'rgba(0,0,0,0)';
...@@ -151,7 +148,6 @@ OfficeExcel.OtherProps = function() ...@@ -151,7 +148,6 @@ OfficeExcel.OtherProps = function()
this._xscale_units_pre = ''; this._xscale_units_pre = '';
this._xscale_units_post = ''; this._xscale_units_post = '';
this._xscale_numlabels = 10; this._xscale_numlabels = 10;
this._xscale_formatter = null;
this._boxplot = false; this._boxplot = false;
} }
\ No newline at end of file
...@@ -118,24 +118,6 @@ ...@@ -118,24 +118,6 @@
this.context.stroke(); this.context.stroke();
}*/ }*/
/**
* Draw label sticks
*/
if (this._otherProps._labels_sticks) {
this.DrawSticks();
// Redraw the border going around the Pie chart if the stroke style is NOT white
var strokeStyle = this._otherProps._strokecolor;
var isWhite = strokeStyle == 'white' || strokeStyle == '#fff' || strokeStyle == '#fffffff' || strokeStyle == 'rgb(255,255,255)' || strokeStyle == 'rgba(255,255,255,0)';
if (!isWhite) {
// Again (?)
this.DrawBorders();
}
}
/** /**
* Draw the labels * Draw the labels
*/ */
...@@ -343,15 +325,6 @@ ...@@ -343,15 +325,6 @@
var explosion_offsetx = 0; var explosion_offsetx = 0;
var explosion_offsety = 0; var explosion_offsety = 0;
} }
/**
* Allow for the label sticks
*/
if (this._otherProps._labels_sticks) {
explosion_offsetx += (Math.cos(angle) * this._otherProps._labels_sticks_length);
explosion_offsety += (Math.sin(angle) * this._otherProps._labels_sticks_length);
}
context.fillStyle = this._otherProps._text_color; context.fillStyle = this._otherProps._text_color;
if(this.catNameLabels && typeof this.catNameLabels[0][lNum] == "string") if(this.catNameLabels && typeof this.catNameLabels[0][lNum] == "string")
...@@ -364,7 +337,7 @@ ...@@ -364,7 +337,7 @@
OfficeExcel.Text(context, OfficeExcel.Text(context,
this._otherProps._text_font, this._otherProps._text_font,
text_size, text_size,
centerx + explosion_offsetx + ((this.radius - 10)* Math.cos(a)) + (this._otherProps._labels_sticks ? (a < 1.57 || a > 4.71 ? 2 : -2) : 0), centerx + explosion_offsetx + ((this.radius - 10)* Math.cos(a)),
this.centery + explosion_offsety + (((this.radius - 10) * Math.sin(a))), this.centery + explosion_offsety + (((this.radius - 10) * Math.sin(a))),
OfficeExcel.numToFormatText(curLabel,isFormatCellTrue), OfficeExcel.numToFormatText(curLabel,isFormatCellTrue),
vAlignment, vAlignment,
...@@ -375,59 +348,6 @@ ...@@ -375,59 +348,6 @@
} }
} }
/**
* This function draws the pie chart sticks (for the labels)
*/
OfficeExcel.Pie.prototype.DrawSticks = function ()
{
var context = this.context;
var offset = this._otherProps._linewidth / 2;
var exploded = this._otherProps._exploded;
var sticks = this._otherProps._labels_sticks;
for (var i=0; i<this.angles.length; ++i) {
if (typeof(sticks) == 'object' && !sticks[i]) {
continue;
}
var radians = this.angles[i][1] - this.angles[i][0];
context.beginPath();
context.strokeStyle = this._otherProps._labels_sticks_color;
context.lineWidth = 1;
var midpoint = (this.angles[i][0] + (radians / 2));
if (typeof(exploded) == 'object' && exploded[i]) {
var extra = exploded[i];
} else if (typeof(exploded) == 'number') {
var extra = exploded;
} else {
var extra = 0;
}
context.lineJoin = 'round';
context.lineWidth = 1;
context.arc(this.centerx,
this.centery,
this.radius + this._otherProps._labels_sticks_length + extra,
midpoint,
midpoint + 0.001,
0);
context.arc(this.centerx,
this.centery,
this.radius + extra,
midpoint,
midpoint + 0.001,
0);
context.stroke();
}
}
OfficeExcel.Pie.prototype.DrawBorders = function () OfficeExcel.Pie.prototype.DrawBorders = function ()
{ {
if (this._otherProps._linewidth > 0) { if (this._otherProps._linewidth > 0) {
......
...@@ -761,11 +761,7 @@ ...@@ -761,11 +761,7 @@
else else
var x = this._chartGutter._left + ((i) * interval); var x = this._chartGutter._left + ((i) * interval);
if (typeof(this._otherProps._xscale_formatter) == 'function') { var text = xScale[i];
var text = this._otherProps._xscale_formatter(this, num);
} else {
var text = xScale[i];
}
OfficeExcel.Text(context, font, text_size, x, this.nullPositionOY + offsetY, OfficeExcel.numToFormatText(text.toString(),isFormatCell), 'center', 'center', false, null, null, bold, null, textOptions); OfficeExcel.Text(context, font, text_size, x, this.nullPositionOY + offsetY, OfficeExcel.numToFormatText(text.toString(),isFormatCell), 'center', 'center', false, null, null, bold, null, textOptions);
} }
...@@ -799,14 +795,10 @@ ...@@ -799,14 +795,10 @@
var num = ( (this._otherProps._xmax - this._otherProps._xmin) * ((i+1) / numXLabels)) + this._otherProps._xmin; var num = ( (this._otherProps._xmax - this._otherProps._xmin) * ((i+1) / numXLabels)) + this._otherProps._xmin;
var x = this._chartGutter._left + ((i+1) * interval); var x = this._chartGutter._left + ((i+1) * interval);
if (typeof(this._otherProps._xscale_formatter) == 'function') { var text = OfficeExcel.number_format(this,
var text = this._otherProps._xscale_formatter(this, num); num.toFixed(this._otherProps._scale_decimals),
} else { units_pre_x,
var text = OfficeExcel.number_format(this, units_post_x);
num.toFixed(this._otherProps._scale_decimals),
units_pre_x,
units_post_x);
}
OfficeExcel.Text(context, font, text_size, x, y, text, 'center', 'center', false, null, null, bold, null, textOptions); OfficeExcel.Text(context, font, text_size, x, y, text, 'center', 'center', 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