Commit 4780117a authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

delete _ylabels_specific

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51880 954022d7-b5bf-4e40-9824-e11837661b57
parent a650a1f2
......@@ -883,27 +883,6 @@
}
else
{
/**
* Draw specific Y labels here so that the local variables can be reused
*/
if (typeof(this._otherProps._ylabels_specific) == 'object' && this._otherProps._ylabels_specific) {
var labels = OfficeExcel.array_reverse(this._otherProps._ylabels_specific);
var grapharea = OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom;
for (var i=0; i<labels.length; ++i) {
var y = this._chartGutter._top + (grapharea * (i / labels.length)) + (grapharea / labels.length);
OfficeExcel.Text(context, font, text_size, xpos, y, labels[i], 'center', align, boxed, null, null, bold, null, textOptions);
}
return;
}
// 1(ish) label
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + interval, '-' + OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
......@@ -989,43 +968,6 @@
var align = this._otherProps._yaxispos == 'left' ? 'right' : 'left';
var boxed = false;
/**
* Draw specific Y labels here so that the local variables can be reused
*/
if (typeof(this._otherProps._ylabels_specific) == 'object' && this._otherProps._ylabels_specific) {
var labels = this._otherProps._ylabels_specific;
var grapharea = this.canvas.height - this._chartGutter._top - this._chartGutter._bottom;
// Draw the top halves labels
for (var i=0; i<labels.length; ++i) {
var y = this._chartGutter._top + ((grapharea / 2) / labels.length) * i;
OfficeExcel.Text(context, font, text_size, xpos, y, String(labels[i]), 'center', align, boxed, null, null, bold, null, textOptions);
}
// Draw the bottom halves labels
for (var i=labels.length-1; i>=0; --i) {
var y = this._chartGutter._top + (grapharea * ( (i+1) / (labels.length * 2) )) + (grapharea / 2);
OfficeExcel.Text(context, font, text_size, xpos, y, labels[labels.length - i - 1], 'center', align, boxed, null, null, bold, null, textOptions);
}
return;
}
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), null, align, boxed);
......@@ -1126,25 +1068,8 @@
var xpos = this._otherProps._yaxispos == 'left' ? this._chartGutter._left - 5 : OfficeExcel.GetWidth(this) - this._chartGutter._right + 5;
var boxed = false;
/**
* Draw specific Y labels here so that the local variables can be reused
*/
if (this._otherProps._ylabels_specific && typeof(this._otherProps._ylabels_specific) == 'object') {
var labels = this._otherProps._ylabels_specific;
var grapharea = this.canvas.height - this._chartGutter._top - this._chartGutter._bottom;
for (var i=0; i<labels.length; ++i) {
var y = this._chartGutter._top + (grapharea * (i / labels.length));
OfficeExcel.Text(context, font, text_size, xpos, y, labels[i], 'center', align, boxed, null, null, bold, null, textOptions);
}
return;
}
// 1 label
if('auto' == numYLabels)
if('auto' == numYLabels)
{
for (var i=0; i<this.scale.length; ++i) {
var stepY;
......
......@@ -56,7 +56,6 @@ OfficeExcel.OtherProps = function()
this._ylabels = true;
this._ylabels_count = 5;
this._ylabels_specific = null;
this._labels = [];
this._labels_above = false;
......
......@@ -464,7 +464,7 @@
}
// Draw the Y axis labels
if (this._otherProps._ylabels && this._otherProps._ylabels_specific == null) {
if (this._otherProps._ylabels) {
var units_pre = this._otherProps._units_pre;
var units_post = this._otherProps._units_post;
......@@ -658,75 +658,6 @@
OfficeExcel.Text(context,font,text_size,xpos,this._otherProps._xaxispos == 'top' ? this._chartGutter._top + this.halfTextHeight: (this.canvas.height - this._chartGutter._bottom + this.halfTextHeight),this._otherProps._units_pre + '0' + this._otherProps._units_post,null, align, bounding, null, bgcolor, bold, null, textOptions);
}
} else if (this._otherProps._ylabels && typeof(this._otherProps._ylabels_specific) == 'object') {
// A few things
var gap = this.grapharea / this._otherProps._ylabels_specific.length;
var halign = this._otherProps._yaxispos == 'left' ? 'right' : 'left';
var bounding = false;
var bgcolor = null;
var ymin = this._otherProps._ymin != null && this._otherProps._ymin;
// Figure out the X coord based on the position of the axis
if (this._otherProps._yaxispos == 'left') {
var x = this._chartGutter._left - 5;
} else if (this._otherProps._yaxispos == 'right') {
var x = this.canvas.width - this._chartGutter._right + 5;
}
// Draw the labels
if (this._otherProps._xaxispos == 'center') {
// Draw the top halfs labels
for (var i=0; i<this._otherProps._ylabels_specific.length; ++i) {
var y = this._chartGutter._top + (this.grapharea / ((this._otherProps._ylabels_specific.length ) * 2) * i);
if (ymin && ymin > 0) {
var y = ((this.grapharea / 2) / (this._otherProps._ylabels_specific.length - (ymin ? 1 : 0)) ) * i;
y += this._chartGutter._top;
}
OfficeExcel.Text(context, font, text_size,x,y,String(this._otherProps._ylabels_specific[i]), 'center', halign, bounding, 0, bgcolor, bold, null, textOptions);
}
// Now reverse the labels and draw the bottom half
var reversed_labels = OfficeExcel.array_reverse(this._otherProps._ylabels_specific);
// Draw the bottom halfs labels
for (var i=0; i<reversed_labels.length; ++i) {
var y = (this.grapharea / 2) + this._chartGutter._top + ((this.grapharea / (reversed_labels.length * 2) ) * (i + 1));
if (ymin && ymin > 0) {
var y = ((this.grapharea / 2) / (reversed_labels.length - (ymin ? 1 : 0)) ) * i;
y += this._chartGutter._top;
y += (this.grapharea / 2);
}
OfficeExcel.Text(context, font, text_size,x,y,String(reversed_labels[i]), 'center', halign, bounding, 0, bgcolor, bold, null, textOptions);
}
} else if (this._otherProps._xaxispos == 'top') {
// Reverse the labels and draw
var reversed_labels = OfficeExcel.array_reverse(this._otherProps._ylabels_specific);
// Draw the bottom halfs labels
for (var i=0; i<reversed_labels.length; ++i) {
var y = ((this.grapharea / (reversed_labels.length - (ymin ? 1 : 0)) ) * (i + (ymin ? 0 : 1)));
y = y + this._chartGutter._top;
OfficeExcel.Text(context, font, text_size,x,y,String(reversed_labels[i]), 'center', halign, bounding, 0, bgcolor, bold, null, textOptions);
}
} else {
for (var i=0; i<this._otherProps._ylabels_specific.length; ++i) {
var y = this._chartGutter._top + ((this.grapharea / (this._otherProps._ylabels_specific.length - (ymin ? 1 : 0) )) * i);
OfficeExcel.Text(context, font, text_size,x,y,String(this._otherProps._ylabels_specific[i]), 'center', halign, bounding, 0, bgcolor, bold, null, textOptions);
}
}
}
// Draw the X axis labels
......
......@@ -440,37 +440,6 @@
}
else
{
if (typeof(this._otherProps._ylabels_specific) == 'object' && this._otherProps._ylabels_specific != null && this._otherProps._ylabels_specific.length) {
var labels = this._otherProps._ylabels_specific;
if (this._otherProps._ymin > 0) {
labels = [];
for (var i=0; i<(this._otherProps._ylabels_specific.length - 1); ++i) {
labels.push(this._otherProps._ylabels_specific[i]);
}
}
for (var i=0; i<labels.length; ++i) {
var y = this._chartGutter._top + (i * (this.grapharea / (labels.length * 2) ) );
OfficeExcel.Text(context, font, text_size, xPos, y, labels[i], 'center', align, boxed, null, null, bold, null, textOptions);
}
var reversed_labels = OfficeExcel.array_reverse(labels);
for (var i=0; i<reversed_labels.length; ++i) {
var y = this._chartGutter._top + (this.grapharea / 2) + ((i+1) * (this.grapharea / (labels.length * 2) ) );
OfficeExcel.Text(context,font, text_size, xPos, y, reversed_labels[i], 'center', align, boxed, null, null, bold, null, textOptions);
}
if (this._otherProps._ymin > 0) {
OfficeExcel.Text(context, font, text_size, xPos, (this.grapharea / 2) + this._chartGutter._top, this._otherProps._ylabels_specific[this._otherProps._ylabels_specific.length - 1], 'center', align, boxed, null, bold, null, textOptions);
}
return;
}
if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
// Draw the top halves labels
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top, OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
......@@ -553,31 +522,6 @@
}
else
{
if (typeof(this._otherProps._ylabels_specific) == 'object' && this._otherProps._ylabels_specific) {
var labels = this._otherProps._ylabels_specific;
// Lose the last label
if (this._otherProps._ymin > 0) {
labels = [];
for (var i=0; i<(this._otherProps._ylabels_specific.length - 1); ++i) {
labels.push(this._otherProps._ylabels_specific[i]);
}
}
for (var i=0; i<labels.length; ++i) {
var y = this._chartGutter._top + (i * (this.grapharea / labels.length) );
OfficeExcel.Text(context, font, text_size, xPos, y, labels[i], 'center', align, boxed, null, bold, null, textOptions);
}
if (this._otherProps._ymin > 0) {
OfficeExcel.Text(context, font, text_size, xPos, this.canvas.height - this._chartGutter._bottom, this._otherProps._ylabels_specific[this._otherProps._ylabels_specific.length - 1], 'center', align, boxed, null,bold, null, textOptions);
}
return;
}
if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top, OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), 'center', align, boxed, 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