Commit 3776963e authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

изменение положения подписей оси 0X при масштабировании

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47579 954022d7-b5bf-4e40-9824-e11837661b57
parent 93d37ab5
......@@ -1429,7 +1429,9 @@
var context = this.context;
var text_angle = this._otherProps._text_angle;
var labels = this._otherProps._labels;
var scaleFactor = 1;
if(OfficeExcel.drawingCtxCharts && OfficeExcel.drawingCtxCharts.scaleFactor)
scaleFactor = OfficeExcel.drawingCtxCharts.scaleFactor;
// Draw the Y axis labels:
if (this._otherProps._ylabels) {
......@@ -1491,7 +1493,7 @@
OfficeExcel.Text(context, font,
text_size,
x + (this._otherProps._text_angle == 90 ? 0 : 0),
this.nullPositionOX + yOffset,
this.nullPositionOX + yOffset*scaleFactor,
String(labels[i++]),
(this._otherProps._text_angle == 90 ? 'center' : null),
halign,
......
......@@ -525,7 +525,9 @@
var units_post = this._otherProps._units_post;
var text_size = this._otherProps._xlabels_size;
var font = this._otherProps._xlabels_font;
var scaleFactor = 1;
if(OfficeExcel.drawingCtxCharts && OfficeExcel.drawingCtxCharts.scaleFactor)
scaleFactor = OfficeExcel.drawingCtxCharts.scaleFactor;
/**
* Set the units to blank if they're to be used for ingraph labels only
......@@ -541,7 +543,7 @@
*/
if (this._otherProps._xlabels) {
var gap = 13;
var gap = 13*scaleFactor;
this.context.beginPath();
this.context.fillStyle = this._otherProps._text_color;
......@@ -600,9 +602,9 @@
//OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/xRevScale.length)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, - OfficeExcel.number_format(this, elemArr, units_pre, units_post), 'center', 'center');
if(elemArr == 0)
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/xRevScale.length)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.numToFormatText(elemArr.toString(),isFormatCell) + units_post, 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/xRevScale.length)), this._chartGutter._top + this.halfTextHeight*scaleFactor + this.graphheight + gap, OfficeExcel.numToFormatText(elemArr.toString(),isFormatCell) + units_post, 'center', 'center', false, null, null, bold, null,textOptions);
else
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/xRevScale.length)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap,OfficeExcel.numToFormatText("-" + elemArr.toString(),isFormatCell) + units_post, 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/xRevScale.length)), this._chartGutter._top + this.halfTextHeight*scaleFactor + this.graphheight + gap,OfficeExcel.numToFormatText("-" + elemArr.toString(),isFormatCell) + units_post, 'center', 'center', false, null, null, bold, null,textOptions);
}
this._otherProps._background_grid_autofit_numvlines = xRevScale.length;
this._otherProps._numxticks = xRevScale.length;
......@@ -617,7 +619,7 @@
elemArr = Math.round(OfficeExcel.array_exp(this.scale[0] - (this.scale[1] - this.scale[0]))*floatKoff)/floatKoff ;
}
//OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/this.scale.length)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, elemArr, units_pre, units_post), 'center', 'center');
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/this.scale.length)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, (OfficeExcel.numToFormatText(elemArr.toString(),isFormatCell) + units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (i/this.scale.length)), this._chartGutter._top + this.halfTextHeight*scaleFactor + this.graphheight + gap, (OfficeExcel.numToFormatText(elemArr.toString(),isFormatCell) + units_post), 'center', 'center', false, null, null, bold, null,textOptions);
}
this._otherProps._background_grid_autofit_numvlines = this.scale.length;
this._otherProps._numxticks = this.scale.length;
......
......@@ -739,6 +739,9 @@
this.context.strokeStyle = 'black';
this.context.fillStyle = this._otherProps._text_color;
this.context.lineWidth = 1;
var scaleFactor = 1;
if(OfficeExcel.drawingCtxCharts && OfficeExcel.drawingCtxCharts.scaleFactor)
scaleFactor = OfficeExcel.drawingCtxCharts.scaleFactor;
// Turn off any shadow
OfficeExcel.NoShadow(this);
......@@ -1185,7 +1188,7 @@
text_size,
labelX,
//(this._otherProps._xaxispos == 'top') ? this._chartGutter._top - yOffset - (this._otherProps._xlabels_inside ? -22 : 0) : (this.canvas.height - this._chartGutter._bottom) + yOffset,
this.nullPositionOX + yOffset,
this.nullPositionOX + yOffset*scaleFactor,
String(this._otherProps._labels[i]),
valign,
halign,
......
......@@ -1004,6 +1004,10 @@
underline: this._otherProps._xlabels_underline,
italic: this._otherProps._xlabels_italic
}
var scaleFactor = 1;
if(OfficeExcel.drawingCtxCharts && OfficeExcel.drawingCtxCharts.scaleFactor)
scaleFactor = OfficeExcel.drawingCtxCharts.scaleFactor;
var offsetY = 15*scaleFactor;
font = this._otherProps._xlabels_font;
text_size = this._otherProps._xlabels_size;
if('auto' == this._otherProps._ylabels_count && this._otherProps._xlabels)
......@@ -1043,9 +1047,9 @@
var text = scale[i];
}
if(text == 0)
OfficeExcel.Text(context, font, text_size, x, this.nullPositionOY + 15,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);
else
OfficeExcel.Text(context, font, text_size, x, this.nullPositionOY + 15, "-" + 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);
}
......@@ -1091,7 +1095,7 @@
var text = xScale[i];
}
OfficeExcel.Text(context, font, text_size, x, this.nullPositionOY + 15, 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);
}
}
......
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