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

delete _labels_ingraph

delete DrawInGraphLabels

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51843 954022d7-b5bf-4e40-9824-e11837661b57
parent 5a61f2a8
......@@ -143,16 +143,6 @@
line.Draw(true);
}
/**
* Draw "in graph" labels
*/
if (this._otherProps._labels_ingraph) {
OfficeExcel.DrawInGraphLabels(this);
}
/**
* This function enables adjusting
*/
......
if (typeof(OfficeExcel) == 'undefined') OfficeExcel = {};
OfficeExcel.Title = function()
{
this._text = '';
this._background = null;
this._color = null;
this._hpos = null;
this._vpos = null;
this._bold = true;
this._font = null;
this._size = null;
};
OfficeExcel.Gutter = function()
{
this._left = 25;
......@@ -105,7 +90,6 @@ OfficeExcel.OtherProps = function()
this._ylabels_invert = false;
this._labels = [];
this._labels_ingraph = null;
this._labels_above = false;
this._labels_above_decimals = 0;
this._labels_above_size = null;
......
......@@ -2155,178 +2155,6 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
obj.context.fill();
}
/**
* Draws in-graph labels.
*
* @param object obj The graph object
*/
OfficeExcel.DrawInGraphLabels = function (obj)
{
var canvas = obj.canvas;
var context = obj.context;
var labels = obj._otherProps._labels_ingraph;
var labels_processed = [];
// Defaults
var fgcolor = 'black';
var bgcolor = 'white';
var direction = 1;
var bold = bar._otherProps._labels_above_bold;
var textOptions =
{
color: bar._otherProps._labels_above_color,
italic: bar._otherProps._labels_above_italic,
underline: bar._otherProps._labels_above_underline
}
if (!labels) {
return;
}
/**
* Preprocess the labels array. Numbers are expanded
*/
for (var i=0; i<labels.length; ++i) {
if (typeof(labels[i]) == 'number') {
for (var j=0; j<labels[i]; ++j) {
labels_processed.push(null);
}
} else if (typeof(labels[i]) == 'string' || typeof(labels[i]) == 'object') {
labels_processed.push(labels[i]);
} else {
labels_processed.push('');
}
}
if (labels_processed && labels_processed.length > 0) {
for (var i=0; i<labels_processed.length; ++i) {
if (labels_processed[i]) {
var coords = obj.coords[i];
if (coords && coords.length > 0) {
var x = (obj.type == 'bar' ? coords[0] + (coords[2] / 2) : coords[0]);
var y = (obj.type == 'bar' ? coords[1] + (coords[3] / 2) : coords[1]);
var length = typeof(labels_processed[i][4]) == 'number' ? labels_processed[i][4] : 25;
context.beginPath();
context.fillStyle = 'black';
context.strokeStyle = 'black';
if (obj.type == 'bar') {
/**
* X axis at the top
*/
if (obj._otherProps._xaxispos == 'top') {
length *= -1;
}
if (obj._otherProps._variant == 'dot') {
context.moveTo(x, obj.coords[i][1] - 5);
context.lineTo(x, obj.coords[i][1] - 5 - length);
var text_x = x;
var text_y = obj.coords[i][1] - 5 - length;
} else if (obj._otherProps._variant == 'arrow') {
context.moveTo(x, obj.coords[i][1] - 5);
context.lineTo(x, obj.coords[i][1] - 5 - length);
var text_x = x;
var text_y = obj.coords[i][1] - 5 - length;
} else {
context.arc(x, y, 2.5, 0, 6.28, 0);
context.moveTo(x, y);
context.lineTo(x, y - length);
var text_x = x;
var text_y = y - length;
}
context.stroke();
context.fill();
} else if (obj.type == 'line') {
if (
typeof(labels_processed[i]) == 'object' &&
typeof(labels_processed[i][3]) == 'number' &&
labels_processed[i][3] == -1
) {
context.moveTo(x, y + 5);
context.lineTo(x, y + 5 + length);
context.stroke();
context.beginPath();
// This draws the arrow
context.moveTo(x, y + 5);
context.lineTo(x - 3, y + 10);
context.lineTo(x + 3, y + 10);
context.closePath();
var text_x = x;
var text_y = y + 5 + length;
} else {
var text_x = x;
var text_y = y - 5 - length;
context.moveTo(x, y - 5);
context.lineTo(x, y - 5 - length);
context.stroke();
context.beginPath();
// This draws the arrow
context.moveTo(x, y - 5);
context.lineTo(x - 3, y - 10);
context.lineTo(x + 3, y - 10);
context.closePath();
}
context.fill();
}
// Taken out on the 10th Nov 2010 - unnecessary
//var width = context.measureText(labels[i]).width;
context.beginPath();
// Fore ground color
context.fillStyle = (typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][1]) == 'string') ? labels_processed[i][1] : 'black';
OfficeExcel.Text(context,
obj._otherProps._text_font,
obj._otherProps._text_size,
text_x,
text_y,
(typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][0]) == 'string') ? labels_processed[i][0] : labels_processed[i],
'bottom',
'center',
true,
null,
(typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][2]) == 'string') ? labels_processed[i][2] : 'white',
bold,
null,
textOptions);
context.fill();
}
}
}
}
}
// Compatibility canvas browser
OfficeExcel.CanvasBrowserCompat = function (context)
{
......
......@@ -154,11 +154,6 @@
if (this._otherProps._key.length) {
OfficeExcel.DrawKey(this, this._otherProps._key, this._otherProps._colors);
}
/**
* Draw "in graph" labels
*/
OfficeExcel.DrawInGraphLabels(this);
}
/**
......
......@@ -308,9 +308,6 @@
if (this._otherProps._labels_above)
this.DrawAboveLabels(isFormatCell);
// Draw in graph labels
OfficeExcel.DrawInGraphLabels(this);
// Redraw the lines if a filled range is on the cards
if (this._otherProps._filled && this._otherProps._filled_range && this.data.length == 2) {
......
......@@ -216,11 +216,6 @@
if (this._otherProps._labels_above) {
this.DrawAboveLabels(isformatCellScOy);
}
/**
* Draw the "in graph" labels, using the member function, NOT the shared function in OfficeExcel.common.core.js
*/
this.DrawInGraphLabels(this);
}
/**
......@@ -1406,99 +1401,6 @@
}
}
/**
* Draws in-graph labels.
*
* @param object obj The graph object
*/
OfficeExcel.Scatter.prototype.DrawInGraphLabels = function (obj)
{
var canvas = obj.canvas;
var context = obj.context;
var labels = obj._otherProps._labels_ingraph;
var labels_processed = [];
// Defaults
var fgcolor = 'black';
var bgcolor = 'white';
var direction = 1;
if (!labels) {
return;
}
/**
* Preprocess the labels array. Numbers are expanded
*/
for (var i=0; i<labels.length; ++i) {
if (typeof(labels[i]) == 'number') {
for (var j=0; j<labels[i]; ++j) {
labels_processed.push(null);
}
} else if (typeof(labels[i]) == 'string' || typeof(labels[i]) == 'object') {
labels_processed.push(labels[i]);
} else {
labels_processed.push('');
}
}
if (labels_processed && labels_processed.length > 0) {
var i=0;
for (var _set=0; _set<obj.coords.length; ++_set) {
for (var point = 0; point<obj.coords[_set].length; ++point) {
if (labels_processed[i]) {
var x = obj.coords[_set][point][0];
var y = obj.coords[_set][point][1];
var length = typeof(labels_processed[i][4]) == 'number' ? labels_processed[i][4] : 25;
var text_x = x;
var text_y = y - 5 - length;
context.moveTo(x, y - 5);
context.lineTo(x, y - 5 - length);
context.stroke();
context.beginPath();
// This draws the arrow
context.moveTo(x, y - 5);
context.lineTo(x - 3, y - 10);
context.lineTo(x + 3, y - 10);
context.closePath();
context.beginPath();
// Fore ground color
context.fillStyle = (typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][1]) == 'string') ? labels_processed[i][1] : 'black';
OfficeExcel.Text(context,
obj._otherProps._text_font,
obj._otherProps._text_size,
text_x,
text_y,
(typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][0]) == 'string') ? labels_processed[i][0] : labels_processed[i],
'bottom',
'center',
true,
null,
(typeof(labels_processed[i]) == 'object' && typeof(labels_processed[i][2]) == 'string') ? labels_processed[i][2] : 'white');
context.fill();
}
i++;
}
}
}
}
/**
* Draws the above line labels
*/
......
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