Commit 122de6e9 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

delete _ylabels_invert

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51861 954022d7-b5bf-4e40-9824-e11837661b57
parent 0d7a7f94
......@@ -80,7 +80,6 @@ OfficeExcel.OtherProps = function()
this._ylabels_inside = false;
this._ylabels_inside_color = null;
this._ylabels_specific = null;
this._ylabels_invert = false;
this._labels = [];
this._labels_above = false;
......
......@@ -23,13 +23,6 @@
OfficeExcel.DrawKey_graph(obj, key, colors);
}
/**
* This does the actual drawing of the key when it's in the graph
*
* @param object obj The graph object
* @param array key The key items to draw
* @param array colors An aray of colors that the key will use
*/
OfficeExcel.DrawKey_graph = function (obj, key, colors)
{
var canvas = obj.canvas;
......
......@@ -614,20 +614,7 @@
}
else
{
var scale = OfficeExcel.array_reverse(this.scale);
/**
* Accommodate reversing the Y labels
*/
if (this._otherProps._ylabels_invert) {
scale = OfficeExcel.array_reverse(scale);
this.context.translate(0, this.grapharea * -0.2);
if (typeof(this._otherProps._ymin) == null) {
this._otherProps._ymin = 0;
}
}
var scale = OfficeExcel.array_reverse(this.scale);
if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((1/5) * (this.grapharea ) ), '-' + OfficeExcel.number_format(this, scale[4], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
......@@ -654,16 +641,8 @@
}
/**
* Accommodate translating back after reversing the labels
*/
if (this._otherProps._ylabels_invert) {
this.context.translate(0, 0 - (this.grapharea * -0.2));
}
if (typeof(this._otherProps._ymin) == 'number') {
OfficeExcel.Text(context,font,text_size,xpos,this._otherProps._ylabels_invert ? this.canvas.height - this._chartGutter._bottom : this._chartGutter._top,'-' + OfficeExcel.number_format(this, this._otherProps._ymin.toFixed(this._otherProps._scale_decimals), units_pre, units_post),'center',align,bounding,null,bgcolor, bold, null, textOptions);
OfficeExcel.Text(context,font,text_size,xpos, this._chartGutter._top,'-' + OfficeExcel.number_format(this, this._otherProps._ymin.toFixed(this._otherProps._scale_decimals), units_pre, units_post),'center',align,bounding,null,bgcolor, bold, null, textOptions);
}
}
......@@ -671,17 +650,6 @@
} else {
/**
* Accommodate reversing the Y labels
*/
if (this._otherProps._ylabels_invert) {
this.scale = OfficeExcel.array_reverse(this.scale);
this.context.translate(0, this.grapharea * 0.2);
if (typeof(this._otherProps._ymin) == null) {
this._otherProps._ymin = 0;
}
}
if('auto' == numYLabels)
{
for (var i=0; i<this.scale.length; ++i) {
......@@ -718,17 +686,8 @@
}
/**
* Accommodate translating back after reversing the labels
*/
if (this._otherProps._ylabels_invert) {
this.context.translate(0, 0 - (this.grapharea * 0.2));
}
if (typeof(this._otherProps._ymin) == 'number' || typeof(this._otherProps._ymin) == 'string' && this._otherProps._ymin.search('E') != -1) {
OfficeExcel.Text(context,font,text_size,xpos - 5,this._otherProps._ylabels_invert ? this._chartGutter._top : this.canvas.height - this._chartGutter._bottom,OfficeExcel.numToFormatText(this._otherProps._ymin.toString(),isFormatCell) + units_post,'center',align,bounding,null,bgcolor, bold, null, textOptions);
//OfficeExcel.Text(context,font,text_size,xpos - 5,this._otherProps._ylabels_invert ? this._chartGutter._top : this.canvas.height - this._chartGutter._bottom,OfficeExcel.number_format(this, this._otherProps._ymin, units_pre, units_post),'center',align,bounding,null,bgcolor);
//OfficeExcel.Text(context,font,text_size,xpos - 5,this._otherProps._ylabels_invert ? this._chartGutter._top : this.canvas.height - this._chartGutter._bottom,OfficeExcel.number_format(this, this._otherProps._ymin.toFixed(this._otherProps._scale_decimals), units_pre, units_post),'center',align,bounding,null,bgcolor);
OfficeExcel.Text(context,font,text_size,xpos - 5,this.canvas.height - this._chartGutter._bottom,OfficeExcel.numToFormatText(this._otherProps._ymin.toString(),isFormatCell) + units_post,'center',align,bounding,null,bgcolor, bold, null, textOptions);
}
}
......@@ -995,12 +954,6 @@
yPos = Math.round(yPos);
}
if (this._otherProps._ylabels_invert) {
yPos -= this._chartGutter._bottom;
yPos -= this._chartGutter._top;
yPos = this.canvas.height - yPos;
}
// Make adjustments depending on the X axis position
if (this._otherProps._xaxispos == 'center') {
yPos = (yPos - this._chartGutter._bottom - this._chartGutter._top) / 2;
......@@ -1012,13 +965,6 @@
yPos = (this.grapharea / (this.max - this.min)) * (Math.abs(data_point) - this.min);
yPos += this._chartGutter._top;
if (this._otherProps._ylabels_invert) {
yPos -= this._chartGutter._top;
yPos = this.grapharea - yPos;
yPos += this._chartGutter._top;
}
} else if (this._otherProps._xaxispos == 'bottom') {
// TODO
yPos -= this._chartGutter._bottom; // Without this the line is out of place due to the gutter
......
......@@ -406,7 +406,6 @@
var units_pre = this._otherProps._units_pre;
var units_post = this._otherProps._units_post;
var numYLabels = this._otherProps._ylabels_count;
var invert = this._otherProps._ylabels_invert;
var inside = this._otherProps._ylabels_inside;
var context = this.context;
var canvas = this.canvas;
......@@ -614,45 +613,22 @@
}
if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
if (invert) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top, OfficeExcel.number_format(this, 0, units_pre, units_post), 'center', align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (5/5) ), OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
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);
if (numYLabels >= 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (2/5) ), OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (4/5) ), OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (3/5) ), OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (1/5) ), OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
} else {
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);
if (numYLabels >= 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (1/5) ), OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (3/5) ), OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
if (numYLabels >= 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (1/5) ), OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (3/5) ), OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (2/5) ), OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (4/5) ), OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (2/5) ), OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (4/5) ), OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
} else if (numYLabels == 10) {
var interval = (this.grapharea / numYLabels) / 2;
if (invert) {
for (var i=numYLabels; i>=0; --i) {
OfficeExcel.Text(context, font, text_size, xPos,this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * ((10-i)/10) ),OfficeExcel.number_format(this,(this.max - (this.max * (i/10))).toFixed((this._otherProps._scale_decimals)), units_pre, units_post),'center', align, boxed, null, bold, null, textOptions);
}
} else {
// 10 Y labels
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context, font, text_size, xPos,this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (i/10) ),OfficeExcel.number_format(this, (this.max - ((this.max - this.min) * (i/10))).toFixed((this._otherProps._scale_decimals)), units_pre, units_post),'center', align, boxed, null, bold, null, textOptions);
}
}
// 10 Y labels
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context, font, text_size, xPos,this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (i/10) ),OfficeExcel.number_format(this, (this.max - ((this.max - this.min) * (i/10))).toFixed((this._otherProps._scale_decimals)), units_pre, units_post),'center', align, boxed, null, bold, null, textOptions);
}
}
if (this._otherProps._ymin) {
......@@ -949,15 +925,6 @@
*/
OfficeExcel.Scatter.prototype.DrawMark = function (index, x, y, xMax, yMax, color, tooltip, coords, data)
{
/**
* Inverted Y scale handling
*/
if (this._otherProps._ylabels_invert) {
if (typeof(y) == 'number') {
y = yMax - y;
}
}
var tickmarks = this._otherProps._tickmarks;
var tickSize = this._otherProps._ticksize;
var xMin = this._otherProps._xmin;
......@@ -1010,17 +977,6 @@
var y2 = (this.graphheight) - ((y[2] - yMin) / (yMax - yMin)) * (this.graphheight);
var y3 = (this.graphheight) - ((y[1] - yMin) / (yMax - yMin)) * (this.graphheight);
var y4 = (this.graphheight) - ((y[0] - yMin) / (yMax - yMin)) * (this.graphheight);
/**
* Inverted labels
*/
if (this._otherProps._ylabels_invert) {
y0 = this.graphheight - y0;
y1 = this.graphheight - y1;
y2 = this.graphheight - y2;
y3 = this.graphheight - y3;
y4 = this.graphheight - y4;
}
var col1 = y[5];
var col2 = y[5];
......
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