Commit fcb0b034 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

delete unused code

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51884 954022d7-b5bf-4e40-9824-e11837661b57
parent 3d004918
......@@ -1863,9 +1863,6 @@ function DrawBarChart(chartCanvas, chartSubType, data, chart) {
bar._otherProps._type = 'accumulative';
if (bar._otherProps._autoGrouping == 'stackedPer') {
for (var j = 0; j < (data.length); j++) {
var maxVal = 0;
var minVal = 0;
var summ = 0;
for (var i = 0; i < data[j].length; i++) {
summ += Math.abs(data[j][i]);
......@@ -1958,7 +1955,6 @@ function DrawHBarChart(chartCanvas, chartSubType, data, chart) {
}
var tempData = data;
var firstData = data;
for (var j = 0; j < (data.length); j++) {
for (var i = 0; i < (data[j].length); i++) {
......
......@@ -146,27 +146,7 @@
{
//определяем куда ставить ось
var numNull = this._otherProps._background_grid_autofit_numhlines;
var arrTemp = []
/*if(typeof(this.data[0]) == 'object')
{
var arrMin = [];
var arrMax = [];
for (var j=0; j < this.data.length; j++) {
min = Math.min.apply(null, this.data[j]);
max = Math.max.apply(null, this.data[j]);
arrMin[j] = min;
arrMax[j] = max;
}
min = Math.min.apply(null, arrMin);
max = Math.max.apply(null, arrMax);
}
else
{
min = Math.min.apply(null, this.data);
max = Math.max.apply(null, this.data);
}*/
if(min >= 0 && max >= 0)
{
numNull = 0;
......@@ -201,16 +181,6 @@
this.nullPositionOX = this.canvas.height - this._chartGutter._bottom - nullPosition;
}
else if (xaxispos == 'center') {
this.context.moveTo(this._chartGutter._left, AA(this, ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / 2) + this._chartGutter._top));
this.context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / 2) + this._chartGutter._top));
} else if (xaxispos == 'top') {
this.context.moveTo(this._chartGutter._left, AA(this, this._chartGutter._top));
this.context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this._chartGutter._top));
} else {
this.context.moveTo(this._chartGutter._left, AA(this, this.canvas.height - this._chartGutter._bottom));
this.context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom));
}
var numYTicks = this._otherProps._numyticks;
......@@ -265,52 +235,6 @@
this.context.lineTo(AA(this, newX), yEnd);
}
}
else if (this._otherProps._noxaxis == false) {
xTickGap = (this.canvas.width - this._chartGutter._left - this._chartGutter._right) / this.data.length;
if (typeof(this._otherProps._xticks) == 'number') {
xTickGap = (this.canvas.width - this._chartGutter._left - this._chartGutter._right) / this._otherProps._xticks;
}
if (xaxispos == 'bottom') {
yStart = this.canvas.height - this._chartGutter._bottom;
yEnd = (this.canvas.height - this._chartGutter._bottom) + 3;
} else if (xaxispos == 'top') {
yStart = this._chartGutter._top - 3;
yEnd = this._chartGutter._top;
} else if (xaxispos == 'center') {
yStart = ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / 2) + this._chartGutter._top + 3;
yEnd = ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / 2) + this._chartGutter._top - 3;
}
yStart = AA(this, yStart);
yEnd = AA(this, yEnd);
//////////////// X TICKS ////////////////
for (x=this._chartGutter._left + (yaxispos == 'left' ? xTickGap : 0); x<this.canvas.width - this._chartGutter._right + (yaxispos == 'left' ? 5 : 0); x+=xTickGap) {
if (yaxispos == 'left' && x > this._chartGutter._left) {
this.context.moveTo(AA(this, x), yStart);
this.context.lineTo(AA(this, x), yEnd);
} else if (yaxispos == 'right' && x < (this.canvas.width - this._chartGutter._right)) {
this.context.moveTo(AA(this, x), yStart);
this.context.lineTo(AA(this, x), yEnd);
}
}
if (this._otherProps._noyaxis || this._otherProps._xticks == null) {
if (typeof(this._otherProps._xticks) == 'number' && this._otherProps._xticks > 0) {
this.context.moveTo(AA(this, this._chartGutter._left), yStart);
this.context.lineTo(AA(this, this._chartGutter._left), yEnd);
}
}
//////////////// X TICKS ////////////////
}
/**
* If the Y axis is not being shown, draw an extra tick
......@@ -341,23 +265,6 @@
var prevY = 0;
var decimals = this._otherProps._scale_decimals;
/**
* Work out the max value
*/
if (this._otherProps._ymax && 'auto' != this._otherProps._ylabels_count) {
this.max = this._otherProps._ymax;
this.min = this._otherProps._ymin;
this.scale = [
(((this.max - this.min) * (1/5)) + this.min).toFixed(decimals),
(((this.max - this.min) * (2/5)) + this.min).toFixed(decimals),
(((this.max - this.min) * (3/5)) + this.min).toFixed(decimals),
(((this.max - this.min) * (4/5)) + this.min).toFixed(decimals),
(((this.max - this.min) * (5/5) + this.min)).toFixed(decimals)
];
} else {
this.min = this._otherProps._ymin;
if('auto' == this._otherProps._ylabels_count)
{
......@@ -367,29 +274,6 @@
this._otherProps._background_grid_autofit_numhlines = lengSc;
this._otherProps._numyticks = lengSc;
}
else if (this._otherProps._ymin) {
var decimals = this._otherProps._scale_decimals;
this.scale[0] = ((Number(this.scale[4] - this.min) * 0.2) + this.min).toFixed(decimals);
this.scale[1] = ((Number(this.scale[4] - this.min) * 0.4) + this.min).toFixed(decimals);
this.scale[2] = ((Number(this.scale[4] - this.min) * 0.6) + this.min).toFixed(decimals);
this.scale[3] = ((Number(this.scale[4] - this.min) * 0.8) + this.min).toFixed(decimals);
this.scale[4] = ((Number(this.scale[4] - this.min) * 1.0) + this.min).toFixed(decimals);
} else {
if (this._otherProps._scale_decimals) {
var decimals = this._otherProps._scale_decimals;
this.scale[0] = Number(this.scale[0]).toFixed(decimals);
this.scale[1] = Number(this.scale[1]).toFixed(decimals);
this.scale[2] = Number(this.scale[2]).toFixed(decimals);
this.scale[3] = Number(this.scale[3]).toFixed(decimals);
this.scale[4] = Number(this.scale[4]).toFixed(decimals);
}
}
}
/**
* Draw horizontal bars here
......@@ -436,8 +320,6 @@
else
height = ((OfficeExcel.array_sum(this.data[i]) < 0 ? OfficeExcel.array_sum(this.data[i] + this.min): OfficeExcel.array_sum(this.data[i]) - this.min) / (this.max - this.min)) * (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom);
}
else
height = ((OfficeExcel.array_sum(this.data[i]) < 0 ? OfficeExcel.array_sum(this.data[i]) + this.min : OfficeExcel.array_sum(this.data[i]) - this.min) / (this.max - this.min) ) * (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom);
// Half the height if the Y axis is at the center
if (xaxispos == 'center') {
......@@ -448,9 +330,6 @@
var y;
if('auto' == this._otherProps._ylabels_count)
y = this.nullPositionOX - height;
else
y = xaxispos == 'center' ? ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / 2) + this._chartGutter._top - height
: this.canvas.height - height - this._chartGutter._bottom;
// xaxispos is top
if (xaxispos == 'top') {
......@@ -634,10 +513,6 @@
else
height = ((OfficeExcel.array_sum(this.data[i][j]) < 0 ? OfficeExcel.array_sum(this.data[i][j] + this.min): OfficeExcel.array_sum(this.data[i][j]) - this.min) / (this.max - this.min)) * (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom);
}
else
{
height = ((this.data[i][j] + (this.data[i][j] < 0 ? this.min : (-1 * this.min) )) / (this.max - this.min) ) * (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom );
}
// If the X axis pos is in the center, we need to half the height
......@@ -647,24 +522,10 @@
var startX = x + hmargin + (j * individualBarWidth);
/**
* Determine the start positioning for the bar
*/
if('auto' == this._otherProps._ylabels_count)
{
var startY = this.nullPositionOX - height;
}
else if (xaxispos == 'top') {
var startY = this._chartGutter._top;
var height = Math.abs(height);
} else if (xaxispos == 'center') {
var startY = this._chartGutter._top + (this.grapharea / 2) - height;
} else {
var startY = this.canvas.height - this._chartGutter._bottom - height;
var height = Math.abs(height);
}
if(this._otherProps._type == 'accumulative' || this._otherProps._autoGrouping == 'stackedPer')
{
......@@ -737,7 +598,6 @@
// Draw the Y axis labels:
if (this._otherProps._ylabels) {
this.Drawlabels_top(isFormatCell);
this.Drawlabels_center(isFormatCell);
this.Drawlabels_bottom(isFormatCell);
}
......@@ -806,22 +666,6 @@
null,
textOptions);
}
else
{
OfficeExcel.Text(context, font,
text_size,
x,
this._otherProps._xaxispos == 'top' ? this._chartGutter._top - yOffset + text_size - 1: (OfficeExcel.GetHeight(this) - this._chartGutter._bottom) + yOffset,
String(labels[i++]),
null,
halign,
null,
angle,
null,
bold,
null,
textOptions);
}
countLabels++;
}
}
......@@ -881,51 +725,6 @@
OfficeExcel.Text(context,font,text_size,xpos - 5,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),OfficeExcel.numToFormatText("-" + elemArr.toString(),isFormatCell),null, align, boxed, null, null, bold, null, textOptions);
}
}
else
{
// 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);
// 5 labels
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (1*interval) + this._chartGutter._top + this.halfTextHeight + interval, '-' + OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (3*interval) + this._chartGutter._top + this.halfTextHeight + interval, '-' + OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
// 3 labels
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (2*interval) + this._chartGutter._top + this.halfTextHeight + interval, '-' + OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (4*interval) + this._chartGutter._top + this.halfTextHeight + interval, '-' + OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
}
// 10 Y labels
if (numYLabels == 10) {
interval = (this.grapharea / numYLabels );
for (var i=10; i>0; --i) {
OfficeExcel.Text(context, font, text_size, xpos,this._chartGutter._top + ((this.grapharea / numYLabels) * i),'-' + OfficeExcel.number_format(this,((this.scale[4] / numYLabels) * i).toFixed((this._otherProps._scale_decimals)), units_pre, units_post), 'center', align, boxed, null, null, bold, null, textOptions);
}
}
/**
* Show the minimum value if its not zero
*/
if (this._otherProps._ymin != 0) {
OfficeExcel.Text(context,
font,
text_size,
xpos,
this._chartGutter._top,
'-' + OfficeExcel.number_format(this,(this.min.toFixed((this._otherProps._scale_decimals))), units_pre, units_post),
'center',
align,
boxed, null, null, bold, null, textOptions);
}
}
}
......@@ -933,110 +732,6 @@
this.context.stroke();
}
/**
* Draws the X axis in the middle
*/
OfficeExcel.Bar.prototype.Drawlabels_center = function (isFormatCell)
{
var font = this._otherProps._xlabels_font;
var numYLabels = this._otherProps._ylabels_count;
var bold = this._otherProps._xlabels_bold;
var textOptions =
{
color: this._otherProps._xlabels_color,
italic: this._otherProps._xlabels_italic,
underline: this._otherProps._xlabels_underline
}
this.context.fillStyle = this._otherProps._text_color;
if (this._otherProps._xaxispos == 'center') {
/**
* Draw the top labels
*/
var interval = (this.grapharea * (1/10) );
var text_size = this._otherProps._xlabels_size;
var units_pre = this._otherProps._units_pre;
var units_post = this._otherProps._units_post;
var context = this.context;
this.context.fillStyle = this._otherProps._text_color;
this.context.strokeStyle = 'black';
var xpos = this._otherProps._yaxispos == 'left' ? this._chartGutter._left - 5 : OfficeExcel.GetWidth(this) - this._chartGutter._right + 5;
var align = this._otherProps._yaxispos == 'left' ? 'right' : 'left';
var boxed = false;
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);
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (1*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (3*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, boxed);
}
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (4*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (2*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
} else if (numYLabels == 10) {
// 10Y labels
interval = (this.grapharea / numYLabels) / 2;
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context, font, text_size, xpos,this._chartGutter._top + ((this.grapharea / (numYLabels * 2)) * i),OfficeExcel.number_format(this, ((this.scale[4] / numYLabels) * (numYLabels - i)).toFixed((this._otherProps._scale_decimals)), units_pre, units_post), 'center', align, boxed, null, null, bold, null, textOptions);
}
}
///////////////////////////////////////////////////////////////////////////////////
/**
* Draw the bottom (X axis) labels
*/
var interval = (this.grapharea) / 10;
if (numYLabels == 3 || numYLabels == 5) {
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (this.grapharea + this._chartGutter._top + this.halfTextHeight) - (4 * interval), '-' + OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (this.grapharea + this._chartGutter._top + this.halfTextHeight) - (2 * interval), '-' + OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, boxed);
}
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (this.grapharea + this._chartGutter._top + this.halfTextHeight) - (3 * interval), '-' + OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (this.grapharea + this._chartGutter._top + this.halfTextHeight) - interval, '-' + OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
OfficeExcel.Text(context, font, text_size, xpos, this.grapharea + this._chartGutter._top + this.halfTextHeight, '-' + OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
} else if (numYLabels == 10) {
// Arbitrary number of Y labels
interval = (this.grapharea / numYLabels) / 2;
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context, font, text_size, xpos,this._chartGutter._top + (this.grapharea / 2) + ((this.grapharea / (numYLabels * 2)) * i) + (this.grapharea / (numYLabels * 2)),OfficeExcel.number_format(this, ((this.scale[4] / numYLabels) * (i+1)).toFixed((this._otherProps._scale_decimals)), '-' + units_pre, units_post),'center', align, boxed, null, null, bold, null, textOptions);
}
}
/**
* Show the minimum value if its not zero
*/
if (this._otherProps._ymin != 0) {
OfficeExcel.Text(context,
font,
text_size,
xpos,
this._chartGutter._top + (this.grapharea / 2),
OfficeExcel.number_format(this,(this.min.toFixed((this._otherProps._scale_decimals))), units_pre, units_post),
'center',
align,
boxed, null, null, bold, null, textOptions);
}
}
}
/**
* Draws the X axdis at the bottom (the default)
*/
......@@ -1073,38 +768,8 @@
{
for (var i=0; i<this.scale.length; ++i) {
var stepY;
/*if(i == this.scale.length)
stepY = this._otherProps._ymin;
else*/
stepY = this.scale[this.scale.length -1 - i]
OfficeExcel.Text(context,font,text_size,xpos - 5,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),OfficeExcel.numToFormatText(stepY.toString(),isFormatCell) + units_post,null,align,boxed, null, null, bold, null, textOptions);
//OfficeExcel.Text(context,font,text_size,xpos - 5,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),OfficeExcel.number_format(this, stepY, units_pre, units_post),null,align,boxed);
}
}
else 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, null, null, bold, null, textOptions);
// 5 labels
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (1*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (3*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
// 3 labels
if (numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, (2*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, (4*interval) + this._chartGutter._top + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, boxed, null, null, bold, null, textOptions);
}
}
// 10 Y labels
if (numYLabels == 10) {
interval = (this.grapharea / numYLabels );
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ((this.grapharea / numYLabels) * i), OfficeExcel.number_format(this,((this.scale[4] / numYLabels) * (numYLabels - i)).toFixed((this._otherProps._scale_decimals)), units_pre, units_post), 'center', align, boxed, null, null, bold, null, textOptions);
}
}
......
......@@ -55,7 +55,7 @@ OfficeExcel.OtherProps = function()
this._xlabels = true;
this._ylabels = true;
this._ylabels_count = 5;
this._ylabels_count = 'auto';
this._labels = [];
this._labels_above = false;
......@@ -73,7 +73,6 @@ OfficeExcel.OtherProps = function()
this._background_grid_autofit = true;
this._background_grid_autofit_numhlines = 5;
this._background_grid_autofit_numvlines = 20;
this._background_grid_autofit_align = false;
this._background_vbars = null;
this._background_hbars = null;
......@@ -87,11 +86,8 @@ OfficeExcel.OtherProps = function()
this._fillstyle = null;
this._smallxticks = 3;
this._largexticks = 5;
this._smallyticks = 3;
this._ticksize = 3;
this._tickdirection = -1;
this._tickmarks = null; // can be reverse
this._tickmarks_dot_color = 'white';
......
......@@ -1110,9 +1110,6 @@
}
return OfficeExcel.array_exp(massRes);
}
}
if (max <= 1) {
......@@ -1461,14 +1458,8 @@
}
}
/**
* This function draws the background for the bar chart, line chart and scatter chart.
*
* @param object obj The graph object
*/
OfficeExcel.background.Draw = function (obj)
{
var canvas = obj.canvas;
var context = obj.context;
var height = 0;
var gutterLeft = obj._chartGutter._left;
......@@ -1504,28 +1495,6 @@
// If autofit is specified, use the .numhlines and .numvlines along with the width to work
// out the hsize and vsize
if (obj._otherProps._background_grid_autofit) {
/**
* Align the grid to the tickmarks
*/
if (obj._otherProps._background_grid_autofit_align) {
// Align the horizontal lines
obj._otherProps._background_grid_autofit_numhlines = obj._otherProps._ylabels_count;
// Align the vertical lines for the line
if (obj.type == 'line') {
if (obj._otherProps._labels && obj._otherProps._labels.length) {
obj._otherProps._background_grid_autofit_numvlines = obj._otherProps._labels.length - 1;
} else {
obj._otherProps._background_grid_autofit_numvlines = obj.data[0].length - 1;
}
// Align the vertical lines for the bar
} else if (obj.type == 'bar' && obj._otherProps._labels && obj._otherProps._labels.length) {
obj._otherProps._background_grid_autofit_numvlines = obj._otherProps._labels.length;
}
}
var vsize = ((obj.canvas.width - gutterLeft - gutterRight)) / obj._otherProps._background_grid_autofit_numvlines;
var hsize = (obj.canvas.height - gutterTop - gutterBottom) / (obj._otherProps._background_grid_autofit_numhlines);
if(vsize > -1 && vsize < 1)
......@@ -1542,13 +1511,7 @@
// Draw the horizontal lines
if (obj._otherProps._background_grid_hlines) {
height = (OfficeExcel.GetHeight(obj) - gutterBottom - gutterTop)
//for (y = gutterTop; y <= (height + gutterTop); y+=obj._otherProps._background_grid_hsize) {
/*for (n = y; n < y + obj._otherProps._background_grid_hsize; n+=(obj._otherProps._background_grid_hsize/5)) {
context.moveTo(gutterLeft, AA(this, n));
context.lineTo(OfficeExcel.GetWidth(obj) - gutterRight, AA(this,n));
}*/
height = (OfficeExcel.GetHeight(obj) - gutterBottom - gutterTop)
height = (OfficeExcel.GetHeight(obj) - gutterBottom - gutterTop);
for (y = gutterTop; y <= height + gutterTop + 1; y+=obj._otherProps._background_grid_hsize) {
if((y + obj._otherProps._background_grid_hsize) > (height + gutterTop + 1))
{
......@@ -1564,14 +1527,6 @@
}
}
// }
/*if (obj._otherProps._background_grid_hlines) {
height = (OfficeExcel.GetHeight(obj) - gutterBottom)
for (y=gutterTop; y<height; y+=obj._otherProps._background_grid_hsize) {
context.moveTo(gutterLeft, AA(this, y));
context.lineTo(OfficeExcel.GetWidth(obj) - gutterRight, AA(this, y));
}
}*/
}
......@@ -1594,42 +1549,6 @@
}
context.stroke();
context.stroke();
if(obj._otherProps._background_grid_hlines_interim)
{
var n = 0;
context.strokeStyle = obj._otherProps._background_grid_hlines_interim_color;
for (y = gutterTop; y < (height + gutterTop); y+=(obj._otherProps._background_grid_hsize/5)) {
if(n%5 != 0 && n != 0)
{
context.moveTo(gutterLeft, AA(this, y));
context.lineTo(OfficeExcel.GetWidth(obj) - gutterRight, AA(this, y));
context.stroke();
}
n++;
}
context.stroke();
}
if(obj._otherProps._background_grid_vlines_interim)
{
var n = 0;
context.strokeStyle = obj._otherProps._background_grid_vlines_interim_color;
var width = (obj.canvas.width - gutterRight)
for (x=gutterLeft; x < width + gutterLeft; x+=obj._otherProps._background_grid_vsize/2) {
if(n%2 != 0 && n != 0)
{
context.moveTo(AA(this, x), gutterTop);
context.lineTo(AA(this, x), obj.canvas.height - gutterBottom);
}
n++;
}
context.stroke();
}
}
}
......
......@@ -148,13 +148,6 @@
//context.moveTo(this._chartGutter._left, AA(this, this.canvas.height - this._chartGutter._bottom - nullPosition));
//context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom - nullPosition));
}
else if (this._otherProps._yaxispos == 'center') {
this.context.moveTo(AA(this, halfway), this._chartGutter._top);
this.context.lineTo(AA(this, halfway), this.canvas.height - this._chartGutter._bottom);
} else {
this.context.moveTo(AA(this, this._chartGutter._left), this._chartGutter._top);
this.context.lineTo(AA(this, this._chartGutter._left), this.canvas.height - this._chartGutter._bottom);
}
}
// Draw the X axis
if(!this._otherProps._noxaxis)
......@@ -182,13 +175,6 @@
this.context.moveTo(this.nullPositionOX, AA(this, y));
this.context.lineTo( this.nullPositionOX - 3, AA(this, y));
}
else if (this._otherProps._yaxispos == 'center') {
this.context.moveTo(halfway + 3, AA(this, y));
this.context.lineTo(halfway - 3, AA(this, y));
} else {
this.context.moveTo(this._chartGutter._left, AA(this, y));
this.context.lineTo( this._chartGutter._left - 3, AA(this, y));
}
}
}
......@@ -246,7 +232,6 @@
if('auto' == this._otherProps._ylabels_count)
{
var elemArr;
var arrTemp = [];
if(typeof(this.data[0]) == 'object')
{
......@@ -267,16 +252,6 @@
var maxX = Math.max.apply(null, this.data);
}
/*for (var i=0; i<this.data.length; i++)
{
arrTemp[i] = this.data[i];
}
var minX = Math.min.apply(null, arrTemp);
var maxX = Math.max.apply(null, arrTemp);*/
if(minX < 0 && maxX <= 0)
{
var xRevScale = OfficeExcel.array_reverse(this.scale);
......@@ -288,7 +263,6 @@
elemArr = Math.round(OfficeExcel.array_exp(xRevScale[xRevScale.length - 1] - (Math.abs(xRevScale[1] - xRevScale[0])))*floatKoff)/floatKoff ;
}
//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*scaleFactor + this.graphheight + gap, OfficeExcel.numToFormatText(elemArr.toString(),isFormatCell) + units_post, 'center', 'center', false, null, null, bold, null,textOptions);
else
......@@ -306,7 +280,7 @@
var floatKoff = 100000000000;
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*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;
......@@ -314,31 +288,6 @@
}
}
else if (this._otherProps._yaxispos == 'center') {
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (10/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[4]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (9/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[3]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (8/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[2]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (7/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[1]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (6/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[0]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (4/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, '-' + OfficeExcel.number_format(this, Number(this.scale[0]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (3/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, '-' + OfficeExcel.number_format(this, Number(this.scale[1]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (2/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, '-' + OfficeExcel.number_format(this, Number(this.scale[2]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (1/10)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, '-' + OfficeExcel.number_format(this, Number(this.scale[3]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (0)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, '-' + OfficeExcel.number_format(this, Number(this.scale[4]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
} else {
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (5/5)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[4]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (4/5)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[3]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (3/5)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[2]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (2/5)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[1]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
OfficeExcel.Text(context, font, text_size, this._chartGutter._left + (this.graphwidth * (1/5)), this._chartGutter._top + this.halfTextHeight + this.graphheight + gap, OfficeExcel.number_format(this, Number(this.scale[0]).toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', 'center', false, null, null, bold, null,textOptions);
if (this._otherProps._xmin > 0) {
OfficeExcel.Text(context,font,text_size,this._chartGutter._left,this._chartGutter._top + this.halfTextHeight + this.graphheight + 2,OfficeExcel.number_format(this, this._otherProps._xmin, units_pre, units_post),'center','center', false, null, null, bold, null,textOptions);
}
}
this.context.fill();
this.context.stroke();
......@@ -377,12 +326,6 @@
OfficeExcel.Text(this.context, font,text_size, this.nullPositionOX - xOffset,y,String(this._otherProps._labels[i++]),'center','right', false, null, null, bold, null,textOptions);
}
}
else
{
for (y=this._chartGutter._top + (yTickGap / 2); y<=OfficeExcel.GetHeight(this) - this._chartGutter._bottom; y+=yTickGap) {
OfficeExcel.Text(this.context, font,text_size,this._chartGutter._left - xOffset,y,String(this._otherProps._labels[i++]),'center','right', false, null, null, bold, null,textOptions);
}
}
}
}
......@@ -409,17 +352,6 @@
this._otherProps._background_grid_autofit_numhlines = lengSc;
this._otherProps._numxticks = lengSc;
}
else
{
this.scale = [
(((this._otherProps._xmax - this._otherProps._xmin) * 0.2) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals),
(((this._otherProps._xmax - this._otherProps._xmin) * 0.4) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals),
(((this._otherProps._xmax - this._otherProps._xmin) * 0.6) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals),
(((this._otherProps._xmax - this._otherProps._xmin) * 0.8) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals),
(((this._otherProps._xmax - this._otherProps._xmin) + this._otherProps._xmin)).toFixed(this._otherProps._scale_decimals)
];
this.max = this.scale[4];
}
} else {
if('auto' == this._otherProps._ylabels_count)
......@@ -429,18 +361,6 @@
this._otherProps._background_grid_autofit_numhlines = lengSc;
this._otherProps._numxticks = lengSc;
}
/**
* Account for xmin
*/
else if (this._otherProps._xmin > 0) {
this.scale[0] = Number((((this.scale[4] - this._otherProps._xmin) * 0.2) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals));
this.scale[1] = Number((((this.scale[4] - this._otherProps._xmin) * 0.4) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals));
this.scale[2] = Number((((this.scale[4] - this._otherProps._xmin) * 0.6) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals));
this.scale[3] = Number((((this.scale[4] - this._otherProps._xmin) * 0.8) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals));
this.scale[4] = Number((((this.scale[4] - this._otherProps._xmin) * 1.0) + this._otherProps._xmin).toFixed(this._otherProps._scale_decimals));
}
if('auto' != this._otherProps._ylabels_count)
this.max = this.scale[4];
}
if (this._otherProps._scale_decimals == null && Number(this.max) == 1) {
......@@ -481,10 +401,6 @@
else
width = ((OfficeExcel.array_sum(this.data[i]) < 0 ? OfficeExcel.array_sum(this.data[i] + tempMin): OfficeExcel.array_sum(this.data[i]) - tempMin) / (tempMax - tempMin)) * (graphwidth);
}
else
width = (this.data[i] / this.max) * graphwidth;
var height = this.graphheight / this.data.length;
var orig_height = height;
......@@ -500,8 +416,6 @@
else
x = this.nullPositionOX;
}
else
x = this._chartGutter._left;
var y = this._chartGutter._top + (i * height);
......@@ -584,8 +498,6 @@
else
width = ((OfficeExcel.array_sum(this.data[i][j]) < 0 ? OfficeExcel.array_sum(this.data[i][j] + tempMin): OfficeExcel.array_sum(this.data[i][j]) - tempMin) / (tempMax - tempMin)) * (graphwidth);
}
else
width = ((this.data[i][j] - this._otherProps._xmin) / (this.max - this._otherProps._xmin)) * (OfficeExcel.GetWidth(this) - this._chartGutter._left - this._chartGutter._right );
......@@ -606,8 +518,6 @@
else
startX = this.nullPositionOX;
}
else
startX = this._chartGutter._left;
var startY = y + vmargin + (j * individualBarHeight);
if(this._otherProps._autoGrouping == 'stackedPer' || this._otherProps._autoGrouping == 'stacked')
......
......@@ -72,7 +72,6 @@
this.max = 0;
// Max y
//if('auto' != this._otherProps._ylabels_count)
if (this._otherProps._ymax && this.scale) {
this.max = this._otherProps._ymax;
......@@ -98,24 +97,6 @@
this._otherProps._background_grid_autofit_numhlines = lengSc;
this._otherProps._numyticks = lengSc;
}
else if (this._otherProps._ymin) {
this.scale[0] = ((this.max - this._otherProps._ymin) * (1/5)) + this._otherProps._ymin;
this.scale[1] = ((this.max - this._otherProps._ymin) * (2/5)) + this._otherProps._ymin;
this.scale[2] = ((this.max - this._otherProps._ymin) * (3/5)) + this._otherProps._ymin;
this.scale[3] = ((this.max - this._otherProps._ymin) * (4/5)) + this._otherProps._ymin;
this.scale[4] = ((this.max - this._otherProps._ymin) * (5/5)) + this._otherProps._ymin;
}
else if (typeof(this._otherProps._scale_decimals) == 'number') {
/*for (var i = 0; i < lengSc;i++) {
this.scale[i] = Number(this.scale[i]).toFixed(this._otherProps._scale_decimals);
}*/
this.scale[0] = Number(this.scale[0]).toFixed(this._otherProps._scale_decimals);
this.scale[1] = Number(this.scale[1]).toFixed(this._otherProps._scale_decimals);
this.scale[2] = Number(this.scale[2]).toFixed(this._otherProps._scale_decimals);
this.scale[3] = Number(this.scale[3]).toFixed(this._otherProps._scale_decimals);
this.scale[4] = Number(this.scale[4]).toFixed(this._otherProps._scale_decimals);
}
}
// Reset coords
......@@ -324,49 +305,6 @@
this.context.lineTo(AA(this, newX), yEnd);
}
}
else if (this._otherProps._noxaxis == false) {
var xTickInterval;
if (this.data[0].length > 0)
xTickInterval = (this.canvas.width - this._chartGutter._left - this._chartGutter._right) / (this._otherProps._xticks ? this._otherProps._xticks : (this.data[0].length - 1));
if (!xTickInterval || xTickInterval <= 0)
xTickInterval = (this.canvas.width - this._chartGutter._left - this._chartGutter._right) / (this._otherProps._labels && this._otherProps._labels.length ? this._otherProps._labels.length - 1 : 10);
for (var x = this._chartGutter._left + (this._otherProps._yaxispos == 'left' ? xTickInterval : 0); x <= (this.canvas.width - this._chartGutter._right + 1 ); x += xTickInterval) {
if (this._otherProps._yaxispos == 'right' && x >= (this.canvas.width - this._chartGutter._right - 1) )
break;
var yStart = this._otherProps._xaxispos == 'center' ? (this._chartGutter._top + (this.grapharea / 2)) - 3 : this.canvas.height - this._chartGutter._bottom;
var yEnd = this._otherProps._xaxispos == 'center' ? yStart + 6 : this.canvas.height - this._chartGutter._bottom - (x % 60 == 0 ? this._otherProps._largexticks * this._otherProps._tickdirection : this._otherProps._smallxticks * this._otherProps._tickdirection);
if (this._otherProps._xaxispos == 'center') {
yStart = AA(this, (this._chartGutter._top + (this.grapharea / 2))) - 3;
yEnd = yStart + 6;
} else if (this._otherProps._xaxispos == 'bottom') {
yStart = this.canvas.height - this._chartGutter._bottom;
yEnd = this.canvas.height - this._chartGutter._bottom - (x % 60 == 0 ? this._otherProps._largexticks * this._otherProps._tickdirection : this._otherProps._smallxticks * this._otherProps._tickdirection);
yEnd += 0.5;
} else if (this._otherProps._xaxispos == 'top') {
yStart = this._chartGutter._top - 3;
yEnd = this._chartGutter._top;
}
this.context.moveTo(AA(this, x), yStart);
this.context.lineTo(AA(this, x), yEnd);
}
} else if (this._otherProps._noyaxis == false) {
if (this._otherProps._yaxispos == 'left') {
this.context.moveTo(this._chartGutter._left, AA(this, this.canvas.height - this._chartGutter._bottom));
this.context.lineTo(this._chartGutter._left - this._otherProps._smallyticks, AA(this, this.canvas.height - this._chartGutter._bottom));
} else {
this.context.moveTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom));
this.context.lineTo(this.canvas.width - this._chartGutter._right + this._otherProps._smallyticks, AA(this, this.canvas.height - this._chartGutter._bottom));
}
}
}
// Draw Y tickmarks
var numyticks = this._otherProps._numyticks;
......@@ -423,18 +361,6 @@
this.context.lineTo(lineto, AA(this, y));
}
}
// Draw an extra X tickmark
/*else if (this._otherProps._noxaxis == false) {
if (this._otherProps._yaxispos == 'left') {
this.context.moveTo(this._chartGutter._left, this._otherProps._xaxispos == 'top' ? this._chartGutter._top : this.canvas.height - this._chartGutter._bottom);
this.context.lineTo(this._chartGutter._left, this._otherProps._xaxispos == 'top' ? this._chartGutter._top - this._otherProps._smallxticks : this.canvas.height - this._chartGutter._bottom + _otherProps._smallxticks);
} else {
this.context.moveTo(this.canvas.width - this._chartGutter._right, this.canvas.height - this._chartGutter._bottom);
this.context.lineTo(this.canvas.width - this._chartGutter._right, this.canvas.height - this._chartGutter._bottom + this._otherProps._smallxticks);
}
}*/
}
this.context.stroke();
}
......@@ -483,65 +409,6 @@
OfficeExcel.Text(context,font,text_size,xpos - 5,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),this.scale[this.scale.length -1 - i],null,align,bounding,null,bgcolor, bold, null, textOptions);
}
}
else
{
if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
// Draw the upper halves labels
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (0/5) * half ) + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (1/5) * half ) + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (3/5) * half ) + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (2/5) * half ) + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (4/5) * half ) + this.halfTextHeight, OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
// Draw the lower halves labels
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (6/5) * half ) + this.halfTextHeight, '-' + OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (8/5) * half ) + this.halfTextHeight, '-' + OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (7/5) * half ) + this.halfTextHeight, '-' + OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (9/5) * half ) + this.halfTextHeight, '-' + OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + ( (10/5) * half ) + this.halfTextHeight, '-' + OfficeExcel.number_format(this, (this.scale[4] == '1.0' ? '1.0' : this.scale[4]), units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
} else if (numYLabels == 10) {
// 10 Y labels
var interval = (this.grapharea / numYLabels) / 2;
for (var i=0; i<numYLabels; ++i) {
// This draws the upper halves labels
OfficeExcel.Text(context,font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((i/20) * (this.grapharea) ), OfficeExcel.number_format(this, ((this.scale[4] / numYLabels) * (numYLabels - i)).toFixed((this._otherProps._scale_decimals)),units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
// And this draws the lower halves labels
OfficeExcel.Text(context, font, text_size, xpos,
this._chartGutter._top + this.halfTextHeight + ((i/20) * this.grapharea) + (this.grapharea / 2) + (this.grapharea / 20),
'-' + OfficeExcel.number_format(this, (this.scale[4] - ((this.scale[4] / numYLabels) * (numYLabels - i - 1))).toFixed((this._otherProps._scale_decimals)),units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
}
if (typeof(this._otherProps._ymin) == 'number') {
OfficeExcel.Text(context, font, text_size, xpos, this.canvas.height / 2, OfficeExcel.number_format(this, this._otherProps._ymin.toFixed(this._otherProps._scale_decimals), units_pre, units_post), 'center', align, bounding, null, bgcolor, bold, null, textOptions);
}
// No X axis - so draw 0
if (this._otherProps._noxaxis == true) {
OfficeExcel.Text(context,font,text_size,xpos,this._chartGutter._top + ( (5/5) * half ) + this.halfTextHeight,this._otherProps._units_pre + '0' + this._otherProps._units_post,null, align, bounding, null, bgcolor, bold, null, textOptions);
}
}
// X axis at the top
} else if (this._otherProps._xaxispos == 'top') {
......@@ -570,42 +437,6 @@
OfficeExcel.Text(context,font,text_size,xpos - 5,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),OfficeExcel.numToFormatText("-" + elemArr.toString(),isFormatCell),null,align,bounding,null,bgcolor, bold, null, textOptions);
}
}
else
{
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);
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((4/5) * (this.grapharea) ), '-' + OfficeExcel.number_format(this, scale[1], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((2/5) * (this.grapharea) ), '-' + OfficeExcel.number_format(this, scale[3], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((3/5) * (this.grapharea ) ), '-' + OfficeExcel.number_format(this, scale[2], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((5/5) * (this.grapharea) ), '-' + OfficeExcel.number_format(this, scale[0], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
} else if (numYLabels == 10) {
// 10 Y labels
var interval = (this.grapharea / numYLabels) / 2;
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context,font,text_size,xpos,(2 * interval) + this._chartGutter._top + this.halfTextHeight + ((i/10) * (this.grapharea) ),'-' + OfficeExcel.number_format(this,(scale[0] - (((scale[0] - this.min) / numYLabels) * (numYLabels - i - 1))).toFixed((this._otherProps._scale_decimals)),units_pre,units_post),null,align,bounding,null,bgcolor, bold, null, textOptions);
}
}
if (typeof(this._otherProps._ymin) == 'number') {
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);
}
}
} else {
if('auto' == numYLabels)
......@@ -620,29 +451,6 @@
}
}
else if (numYLabels == 1 || numYLabels == 3 || numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((0/5) * (this.grapharea ) ), OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((3/5) * (this.grapharea) ), OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((1/5) * (this.grapharea) ), OfficeExcel.number_format(this, this.scale[3], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((2/5) * (this.grapharea ) ), OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xpos, this._chartGutter._top + this.halfTextHeight + ((4/5) * (this.grapharea) ), OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), null, align, bounding, null, bgcolor, bold, null, textOptions);
}
} else if (numYLabels == 10) {
// 10 Y labels
var interval = (this.grapharea / numYLabels) / 2;
for (var i=0; i<numYLabels; ++i) {
OfficeExcel.Text(context,font,text_size,xpos,this._chartGutter._top + this.halfTextHeight + ((i/10) * (this.grapharea) ),OfficeExcel.number_format(this,((((this.scale[4] - this.min) / numYLabels) * (numYLabels - i)) + this.min).toFixed((this._otherProps._scale_decimals)),units_pre,units_post),null,align,bounding,null,bgcolor, bold, null, textOptions);
}
}
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.canvas.height - this._chartGutter._bottom,OfficeExcel.numToFormatText(this._otherProps._ymin.toString(),isFormatCell) + units_post,'center',align,bounding,null,bgcolor, bold, null, textOptions);
......@@ -739,22 +547,6 @@
angle,
bgcolor, bold, null, textOptions);
}
else
{
OfficeExcel.Text(context,
font,
text_size,
labelX,
(this._otherProps._xaxispos == 'top') ? this._chartGutter._top - yOffset : (this.canvas.height - this._chartGutter._bottom) + yOffset,
//this.nullPositionOX + 20,
String(this._otherProps._labels[i]),
valign,
halign,
bordered,
angle,
bgcolor, bold, null, textOptions);
}
}
}
......
......@@ -49,31 +49,6 @@
// Reset the maximum value
this.max = 0;
// Work out the maximum Y value
if (this._otherProps._ymax && 'auto' != this._otherProps._ylabels_count) {
this.scale = [];
this.max = this._otherProps._ymax;
this.min = this._otherProps._ymin ? this._otherProps._ymin : 0;
this.scale[0] = ((this.max - this.min) * (1/5)) + this.min;
this.scale[1] = ((this.max - this.min) * (2/5)) + this.min;
this.scale[2] = ((this.max - this.min) * (3/5)) + this.min;
this.scale[3] = ((this.max - this.min) * (4/5)) + this.min;
this.scale[4] = ((this.max - this.min) * (5/5)) + this.min;
var decimals = this._otherProps._scale_decimals;
this.scale = [
Number(this.scale[0]).toFixed(decimals),
Number(this.scale[1]).toFixed(decimals),
Number(this.scale[2]).toFixed(decimals),
Number(this.scale[3]).toFixed(decimals),
Number(this.scale[4]).toFixed(decimals)
];
} else {
var i = 0;
var j = 0;
if('auto' == this._otherProps._ylabels_count && undefined != this._otherProps._ymax)
......@@ -114,34 +89,6 @@
this._otherProps._background_grid_autofit_numvlines = xScale.length - 1;
this._otherProps._numxticks = xScale.length;
}
else
{
this.max = this.scale[4];
this.min = this._otherProps._ymin ? this._otherProps._ymin : 0;
if (this.min) {
this.scale[0] = ((this.max - this.min) * (1/5)) + this.min;
this.scale[1] = ((this.max - this.min) * (2/5)) + this.min;
this.scale[2] = ((this.max - this.min) * (3/5)) + this.min;
this.scale[3] = ((this.max - this.min) * (4/5)) + this.min;
this.scale[4] = ((this.max - this.min) * (5/5)) + this.min;
}
if (typeof(this._otherProps._scale_decimals) == 'number') {
var decimals = this._otherProps._scale_decimals;
this.scale = [
Number(this.scale[0]).toFixed(decimals),
Number(this.scale[1]).toFixed(decimals),
Number(this.scale[2]).toFixed(decimals),
Number(this.scale[3]).toFixed(decimals),
Number(this.scale[4]).toFixed(decimals)
];
}
}
}
this.grapharea = this.canvas.height - this._chartGutter._top - this._chartGutter._bottom;
......@@ -270,13 +217,6 @@
//context.moveTo(this._chartGutter._left, AA(this, this.canvas.height - this._chartGutter._bottom - nullPosition));
//context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom - nullPosition));
}
else if (this._otherProps._yaxispos == 'left') {
context.moveTo(AA(this, this._chartGutter._left), this._chartGutter._top);
context.lineTo(AA(this, this._chartGutter._left), OfficeExcel.GetHeight(this) - this._chartGutter._bottom);
} else {
context.moveTo(AA(this, OfficeExcel.GetWidth(this) - this._chartGutter._right), this._chartGutter._top);
context.lineTo(AA(this, OfficeExcel.GetWidth(this) - this._chartGutter._right), OfficeExcel.GetHeight(this) - this._chartGutter._bottom);
}
}
// Draw the X axis
......@@ -337,11 +277,6 @@
context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom - nullPosition));
this.nullPositionOY = this.canvas.height - this._chartGutter._bottom - nullPosition;
}
else
{
context.moveTo(this._chartGutter._left, AA(this, this.canvas.height - this._chartGutter._bottom));
context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, this.canvas.height - this._chartGutter._bottom));
}
}
}
/**
......@@ -427,60 +362,12 @@
}
if (this._otherProps._xaxispos == 'center') {
/**
* Specific Y labels
*/
if('auto' == numYLabels)
{
for (var i=0; i<this.scale.length; ++i) {
OfficeExcel.Text(context,font,text_size,this.nullPositionOX - 10,this._chartGutter._top + this.halfTextHeight + ((i/this.scale.length) * (this.grapharea) ),OfficeExcel.numToFormatText(this.scale[this.scale.length -1 - i],isformatCellScOy),null,align,bounding,null,bgcolor, bold, null, textOptions);
}
}
else
{
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);
if (numYLabels >= 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (1/10) ), 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 + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (3/10) ), OfficeExcel.number_format(this, this.scale[1], units_pre, units_post), 'center', align, boxed, null, null, bold, null, textOptions);
}
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (2/10) ), 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 + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (4/10) ), OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
// Draw the bottom halves labels
if (numYLabels >= 3) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (1/10) ) + this.halfGraphHeight, '-' + OfficeExcel.number_format(this, this.scale[0], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (3/10) ) + this.halfGraphHeight, '-' + OfficeExcel.number_format(this, this.scale[2], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
if (numYLabels == 5) {
OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (2/10) ) + this.halfGraphHeight, '-' + 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 + ((OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) * (4/10) ) + this.halfGraphHeight, '-' + 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) * (5/10) ) + this.halfGraphHeight, '-' + OfficeExcel.number_format(this, this.scale[4], units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
} else if (numYLabels == 10) {
// 10 Y labels
var interval = (this.grapharea / numYLabels) / 2;
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/20) ),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);
OfficeExcel.Text(context, font, text_size, xPos,this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (i/20) ) + (this.grapharea / 2) + (this.grapharea / 20),'-' + OfficeExcel.number_format(this, ((this.max * (i/10)) + (this.max * (1/10))).toFixed((this._otherProps._scale_decimals)), units_pre, units_post), 'center', align, boxed, null, bold, null, textOptions);
}
}
}
}
else if (this._otherProps._xaxispos == 'top' && 'auto' == numYLabels)
{
......@@ -520,32 +407,6 @@
//OfficeExcel.Text(context, font, text_size, xPos, this._chartGutter._top + ((this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) * (4/5) ), this.scale[this.scale.length -1 - i], 'center', align, boxed);
}
}
else
{
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);
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);
}
} else if (numYLabels == 10) {
// 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) {
OfficeExcel.Text(context, font, text_size, xPos, this.canvas.height - this._chartGutter._bottom,OfficeExcel.number_format(this, this._otherProps._ymin.toFixed(this._otherProps._scale_decimals), units_pre, units_post),'center', align, boxed, 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