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

refactoring charts code

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51837 954022d7-b5bf-4e40-9824-e11837661b57
parent 64dbbcf6
...@@ -6,9 +6,8 @@ function ChartRender(options) { ...@@ -6,9 +6,8 @@ function ChartRender(options) {
this.options = options; this.options = options;
this.insertChart = function(chart, activeWorkSheet, width, height, isNewChart, bChartPreview) { this.insertChart = function(chart, width, height, bChartPreview) {
var chartBase64 = null;
if ( bChartPreview ) if ( bChartPreview )
g_bChartPreview = true; g_bChartPreview = true;
else else
...@@ -28,12 +27,8 @@ function ChartRender(options) { ...@@ -28,12 +27,8 @@ function ChartRender(options) {
$(chartCanvas).css('height', height); $(chartCanvas).css('height', height);
$(chartCanvas)[0].height = height; $(chartCanvas)[0].height = height;
$(chartCanvas)[0].width = width; $(chartCanvas)[0].width = width;
//if ( insertChart(chart, activeWorkSheet, width, height, isNewChart) ) insertChart(chart, this.options);
// chartBase64 = chartCanvas.toDataURL();
//return chartBase64;
insertChart(chart, activeWorkSheet, width, height, isNewChart, this.options);
var ret = chartCanvas; var ret = chartCanvas;
chartCanvas = null; chartCanvas = null;
return ret; return ret;
...@@ -463,17 +458,17 @@ function ChartPreviewManager() { ...@@ -463,17 +458,17 @@ function ChartPreviewManager() {
chart.subType = c_oAscChartSubType.normal; chart.subType = c_oAscChartSubType.normal;
fillChartData(chart); fillChartData(chart);
var chartBase64 = chartRender.insertChart( chart, null, preview_w, preview_h, false, true ).toDataURL(); var chartBase64 = chartRender.insertChart( chart, preview_w, preview_h, true ).toDataURL();
previewGroups[chartType][c_oAscChartSubType.normal][style] = chartBase64; previewGroups[chartType][c_oAscChartSubType.normal][style] = chartBase64;
chart.subType = c_oAscChartSubType.stacked; chart.subType = c_oAscChartSubType.stacked;
fillChartData(chart); fillChartData(chart);
var chartBase64 = chartRender.insertChart( chart, null, preview_w, preview_h, false, true ).toDataURL(); var chartBase64 = chartRender.insertChart( chart, preview_w, preview_h, true ).toDataURL();
previewGroups[chartType][c_oAscChartSubType.stacked][style] = chartBase64; previewGroups[chartType][c_oAscChartSubType.stacked][style] = chartBase64;
chart.subType = c_oAscChartSubType.stackedPer; chart.subType = c_oAscChartSubType.stackedPer;
fillChartData(chart); fillChartData(chart);
var chartBase64 = chartRender.insertChart( chart, null, preview_w, preview_h, false, true ).toDataURL(); var chartBase64 = chartRender.insertChart( chart, preview_w, preview_h, true ).toDataURL();
previewGroups[chartType][c_oAscChartSubType.stackedPer][style] = chartBase64; previewGroups[chartType][c_oAscChartSubType.stackedPer][style] = chartBase64;
break; break;
...@@ -484,7 +479,7 @@ function ChartPreviewManager() { ...@@ -484,7 +479,7 @@ function ChartPreviewManager() {
chart.subType = c_oAscChartSubType.normal; chart.subType = c_oAscChartSubType.normal;
fillChartData(chart); fillChartData(chart);
var chartBase64 = chartRender.insertChart( chart, null, preview_w, preview_h, false, true ).toDataURL(); var chartBase64 = chartRender.insertChart( chart, preview_w, preview_h, true ).toDataURL();
previewGroups[chartType][c_oAscChartSubType.normal][style] = chartBase64; previewGroups[chartType][c_oAscChartSubType.normal][style] = chartBase64;
break; break;
...@@ -929,13 +924,12 @@ function formulaToRange(formula, worksheet) { ...@@ -929,13 +924,12 @@ function formulaToRange(formula, worksheet) {
return range; return range;
} }
function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) { function insertChart(chart, options) {
var isSeries = false; var isSeries = false;
var formatCell = 'General'; var formatCell = 'General';
var formatCellScOy = 'General'; var formatCellScOy = 'General';
var defaultFormat = 'General'; var defaultFormat = 'General';
var isDateTimeFormat; var isDateTimeFormat;
var catNameFormat;
var api_doc = window["editor"]; var api_doc = window["editor"];
var api_sheet = window["Asc"]["editor"]; var api_sheet = window["Asc"]["editor"];
...@@ -1267,7 +1261,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -1267,7 +1261,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
if(newArr != undefined) if(newArr != undefined)
{ {
chart.arrFormatAdobeLabels = newAdobeLabels; chart.arrFormatAdobeLabels = newAdobeLabels;
drawChart(chart, newArr, width, height, options); drawChart(chart, newArr, options);
} }
else else
{ {
...@@ -1281,7 +1275,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -1281,7 +1275,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
chart.arrFormatAdobeLabels = arrReverse(arrFormatAdobeLabels); chart.arrFormatAdobeLabels = arrReverse(arrFormatAdobeLabels);
if(catNameLabels && catNameLabels.length) if(catNameLabels && catNameLabels.length)
chart.catNameLabels = arrReverse(catNameLabels); chart.catNameLabels = arrReverse(catNameLabels);
drawChart(chart, arrValuesRev, width, height, options); drawChart(chart, arrValuesRev, options);
} }
else else
{ {
...@@ -1289,7 +1283,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -1289,7 +1283,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
chart.arrFormatAdobeLabels = arrFormatAdobeLabels; chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
if(catNameLabels && catNameLabels.length) if(catNameLabels && catNameLabels.length)
chart.catNameLabels = catNameLabels; chart.catNameLabels = catNameLabels;
drawChart(chart, arrValues, width, height, options); drawChart(chart, arrValues, options);
} }
} }
else else
...@@ -1300,13 +1294,13 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -1300,13 +1294,13 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
{ {
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev; chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev;
drawChart(chart, arrValuesRev, width, height); drawChart(chart, arrValuesRev);
} }
else else
{ {
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabels; chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
drawChart(chart, arrValues, width, height, options); drawChart(chart, arrValues, options);
} }
} }
else else
...@@ -1315,14 +1309,14 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -1315,14 +1309,14 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
{ {
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabels; chart.arrFormatAdobeLabels = arrFormatAdobeLabels;
drawChart(chart, arrValues, width, height, options); drawChart(chart, arrValues, options);
} }
else else
{ {
//chart.isSkip = isSkipRev; //chart.isSkip = isSkipRev;
chart.isSkip = isSkip; chart.isSkip = isSkip;
chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev; chart.arrFormatAdobeLabels = arrFormatAdobeLabelsRev;
drawChart(chart, arrValuesRev, width, height, options); drawChart(chart, arrValuesRev, options);
} }
} }
} }
...@@ -1344,7 +1338,7 @@ function arrReverse(arr) { ...@@ -1344,7 +1338,7 @@ function arrReverse(arr) {
return newarr; return newarr;
} }
function drawChart(chart, arrValues, width, height, options) { function drawChart(chart, arrValues, options) {
var data = arrValues; var data = arrValues;
var api_doc = window["editor"]; var api_doc = window["editor"];
...@@ -1429,7 +1423,7 @@ function drawChart(chart, arrValues, width, height, options) { ...@@ -1429,7 +1423,7 @@ function drawChart(chart, arrValues, width, height, options) {
var curColor; var curColor;
var rgba; var rgba;
if(chart.type == 'Pie' || chart.type == 'Bar' || chart.type == 'HBar') if(chart.type == 'Pie' || chart.type == 'Bar' || chart.type == 'HBar')
legendCnt = data[0].length legendCnt = data[0].length;
if(chart.type == "Stock") if(chart.type == "Stock")
legendCnt = 4; legendCnt = 4;
//если есть объект series //если есть объект series
...@@ -1563,24 +1557,6 @@ function drawChart(chart, arrValues, width, height, options) { ...@@ -1563,24 +1557,6 @@ function drawChart(chart, arrValues, width, height, options) {
else else
bar._otherProps._labels_above = false; bar._otherProps._labels_above = false;
} }
if (chart.xAxis.title && !chart.margins) {
var legendTop = 0;
var widthXtitle = bar.context.measureText(chart.xAxis.title).width;
if(chart.legend.position == 'bottom')
legendTop = 30;
bar._xAxisTitle._text = chart.xAxis.title;
}
if (chart.yAxis.title && !chart.margins) {
var widthYtitle = bar.context.measureText(chart.yAxis.title).width;
bar._yAxisTitle._text = chart.yAxis.title;
bar._yAxisTitle._align = 'rev';
var keyLeft = 0;
if (bar._otherProps._key_halign == 'left')
keyLeft = 70;
bar._yAxisTitle._angle = 'null';
}
// Основная сетка // Основная сетка
bar._otherProps._background_grid_hlines = chart.xAxis.bGrid; bar._otherProps._background_grid_hlines = chart.xAxis.bGrid;
......
...@@ -1642,59 +1642,6 @@ ...@@ -1642,59 +1642,6 @@
this.context.fill(); this.context.fill();
this.context.stroke(); this.context.stroke();
} }
/**
* When you click on the chart, this method can return the Y value at that point. It works for any point on the
* chart (that is inside the gutters) - not just points within the Bars.
*
* EITHER:
*
* @param object arg The event object
*
* OR:
*
* @param object arg A two element array containing the X and Y coordinates
*/
OfficeExcel.Bar.prototype.getValue = function (arg)
{
if (arg.length == 2) {
var mouseX = arg[0];
var mouseY = arg[1];
} else {
var mouseCoords = OfficeExcel.getMouseXY(arg);
var mouseX = mouseCoords[0];
var mouseY = mouseCoords[1];
}
if ( mouseY < this._chartGutter._top
|| mouseY > (this.canvas.height - this._chartGutter._bottom)
|| mouseX < this._chartGutter._left
|| mouseX > (this.canvas.width - this._chartGutter._right)
) {
return null;
}
if (this._otherProps._xaxispos == 'center') {
var value = (((this.grapharea / 2) - (mouseY - this._chartGutter._top)) / this.grapharea) * (this.max - this.min)
value *= 2;
if (value >= 0) {
value += this.min;
} else {
value -= this.min;
}
} else if (this._otherProps._xaxispos == 'top') {
var value = ((this.grapharea - (mouseY - this._chartGutter._top)) / this.grapharea) * (this.max - this.min)
value = this.max - value;
value = Math.abs(value) * -1;
} else {
var value = ((this.grapharea - (mouseY - this._chartGutter._top)) / this.grapharea) * (this.max - this.min)
value += this.min;
}
return value;
}
OfficeExcel.Bar.prototype.DrawAboveLabels = function (isFormatCell) OfficeExcel.Bar.prototype.DrawAboveLabels = function (isFormatCell)
{ {
......
...@@ -155,8 +155,6 @@ OfficeExcel.OtherProps = function() ...@@ -155,8 +155,6 @@ OfficeExcel.OtherProps = function()
this._tickmarks_dot_color = 'white'; this._tickmarks_dot_color = 'white';
this._key = []; this._key = [];
this._key_position_x = null;
this._key_position_y = null;
this._key_color_shape = 'square'; this._key_color_shape = 'square';
this._key_colors = null; this._key_colors = null;
this._key_halign = 'right'; this._key_halign = 'right';
......
...@@ -1763,43 +1763,6 @@ ...@@ -1763,43 +1763,6 @@
} }
} }
/**
* This function returns the mouse position in relation to the canvas
*
* @param object e The event object.
*/
OfficeExcel.getMouseXY = function (e)
{
var obj = (OfficeExcel.isIE8() ? event.srcElement : e.target);
var x;
var y;
if (OfficeExcel.isIE8()) e = event;
// Browser with offsetX and offsetY
if (typeof(e.offsetX) == 'number' && typeof(e.offsetY) == 'number') {
x = e.offsetX;
y = e.offsetY;
// FF and other
} else {
x = 0;
y = 0;
while (obj != document.body && obj) {
x += obj.offsetLeft;
y += obj.offsetTop;
obj = obj.offsetParent;
}
x = e.pageX - x;
y = e.pageY - y;
}
return [x, y];
}
/** /**
* This function draws the background for the bar chart, line chart and scatter chart. * This function draws the background for the bar chart, line chart and scatter chart.
* *
...@@ -2466,79 +2429,6 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -2466,79 +2429,6 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
} }
} }
/**
* Draws a filled rectangle with curvy corners
*
* @param context object The context
* @param x number The X coordinate (top left of the square)
* @param y number The Y coordinate (top left of the square)
* @param w number The width of the rectangle
* @param h number The height of the rectangle
* @param number The radius of the curved corners
* @param boolean Whether the top left corner is curvy
* @param boolean Whether the top right corner is curvy
* @param boolean Whether the bottom right corner is curvy
* @param boolean Whether the bottom left corner is curvy
*/
OfficeExcel.filledCurvyRect = function (context, x, y, w, h)
{
// The corner radius
var r = arguments[5] ? arguments[5] : 3;
// The corners
var corner_tl = (arguments[6] || arguments[6] == null) ? true : false;
var corner_tr = (arguments[7] || arguments[7] == null) ? true : false;
var corner_br = (arguments[8] || arguments[8] == null) ? true : false;
var corner_bl = (arguments[9] || arguments[9] == null) ? true : false;
context.beginPath();
// First draw the corners
// Top left corner
if (corner_tl) {
context.moveTo(x + r, y + r);
context.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI, false);
} else {
context.fillRect(x, y, r, r);
}
// Top right corner
if (corner_tr) {
context.moveTo(x + w - r, y + r);
context.arc(x + w - r, y + r, r, 1.5 * Math.PI, 0, false);
} else {
context.moveTo(x + w - r, y);
context.fillRect(x + w - r, y, r, r);
}
// Bottom right corner
if (corner_br) {
context.moveTo(x + w - r, y + h - r);
context.arc(x + w - r, y - r + h, r, 0, Math.PI / 2, false);
} else {
context.moveTo(x + w - r, y + h - r);
context.fillRect(x + w - r, y + h - r, r, r);
}
// Bottom left corner
if (corner_bl) {
context.moveTo(x + r, y + h - r);
context.arc(x + r, y - r + h, r, Math.PI / 2, Math.PI, false);
} else {
context.moveTo(x, y + h - r);
context.fillRect(x, y + h - r, r, r);
}
// Now fill it in
context.fillRect(x + r, y, w - r - r, h);
context.fillRect(x, y + r, r + 1, h - r - r);
context.fillRect(x + w - r - 1, y + r, r + 1, h - r - r);
context.fill();
}
// Checks the browser for traces of MSIE8 // Checks the browser for traces of MSIE8
OfficeExcel.isIE8 = function () OfficeExcel.isIE8 = function ()
{ {
......
...@@ -154,18 +154,6 @@ ...@@ -154,18 +154,6 @@
} }
} }
/**
* Specific location coordinates
*/
if (typeof(obj._otherProps._key_position_x) == 'number') {
hpos = obj._otherProps._key_position_x;
}
if (typeof(obj._otherProps._key_position_y) == 'number') {
vpos = obj._otherProps._key_position_y;
}
// Draw the box that the key resides in // Draw the box that the key resides in
context.beginPath(); context.beginPath();
context.fillStyle = 'white'; context.fillStyle = 'white';
......
...@@ -834,50 +834,4 @@ ...@@ -834,50 +834,4 @@
border ? 'rgba(255,255,255,0.9)' : null, bold, null, textOptions); border ? 'rgba(255,255,255,0.9)' : null, bold, null, textOptions);
} }
} }
} }
\ No newline at end of file
/**
* When you click on the chart, this method can return the X value at that point. It works for any point on the
* chart (that is inside the gutters) - not just points within the Bars.
*
* @param object e The event object
*/
OfficeExcel.HBar.prototype.getValue = function (arg)
{
if (arg.length == 2) {
var mouseX = arg[0];
var mouseY = arg[1];
} else {
var mouseCoords = OfficeExcel.getMouseXY(arg);
var mouseX = mouseCoords[0];
var mouseY = mouseCoords[1];
}
if ( mouseY < this._chartGutter._top
|| mouseY > (this.canvas.height - this._chartGutter._bottom)
|| mouseX < this._chartGutter._left
|| mouseX > (this.canvas.width - this._chartGutter._right)
) {
return null;
}
if (this._otherProps._yaxispos == 'center') {
var value = ((mouseX - this._chartGutter._left) / (this.graphwidth / 2)) * (this.max - this._otherProps._xmin);
value = value - this.max
// Special case if xmin is defined
if (this._otherProps._xmin > 0) {
value = ((mouseX - this._chartGutter._left - (this.graphwidth / 2)) / (this.graphwidth / 2)) * (this.max - this._otherProps._xmin);
value += this._otherProps._xmin;
if (mouseX < (this._chartGutter._left + (this.graphwidth / 2))) {
value -= (2 * this._otherProps._xmin);
}
}
} else {
var value = ((mouseX - this._chartGutter._left) / this.graphwidth) * (this.max - this._otherProps._xmin);
value += this._otherProps._xmin;
}
return value;
}
\ No newline at end of file
...@@ -1844,47 +1844,4 @@ ...@@ -1844,47 +1844,4 @@
} }
co.stroke(); co.stroke();
}
/**
* When you click on the chart, this method can return the Y value at that point. It works for any point on the
* chart (that is inside the gutters) - not just points on the Line.
*
* @param object e The event object
*/
OfficeExcel.Line.prototype.getValue = function (arg)
{
if (arg.length == 2) {
var mouseX = arg[0];
var mouseY = arg[1];
} else {
var mouseCoords = OfficeExcel.getMouseXY(arg);
var mouseX = mouseCoords[0];
var mouseY = mouseCoords[1];
}
var obj = this;
if ( mouseY < obj._chartGutter._top
|| mouseY > (obj.canvas.height - obj._chartGutter._bottom)
|| mouseX < this._chartGutter._left
|| mouseX > (obj.canvas.width - obj._chartGutter._right)
) {
return null;
}
if (this._otherProps._xaxispos == 'center') {
var value = (( (obj.grapharea / 2) - (mouseY - obj._chartGutter._top)) / obj.grapharea) * (obj.max - obj.min);
value *= 2;
return value;
} else if (this._otherProps._xaxispos == 'top') {
var value = ((obj.grapharea - (mouseY - obj._chartGutter._top)) / obj.grapharea) * (obj.max - obj.min);
value = Math.abs(obj.max - value) * -1;
return value;
} else {
var value = ((obj.grapharea - (mouseY - obj._chartGutter._top)) / obj.grapharea) * (obj.max - obj.min)
value += obj.min;
return value;
}
} }
\ No newline at end of file
...@@ -1546,47 +1546,4 @@ ...@@ -1546,47 +1546,4 @@
'rgba(255, 255, 255, 0.7)', bold, null, textOptions); 'rgba(255, 255, 255, 0.7)', bold, null, textOptions);
} }
} }
}
/**
* When you click on the chart, this method can return the Y value at that point. It works for any point on the
* chart (that is inside the gutters) - not just points within the Bars.
*
* @param object e The event object
*/
OfficeExcel.Scatter.prototype.getValue = function (arg)
{
if (arg.length == 2) {
var mouseX = arg[0];
var mouseY = arg[1];
} else {
var mouseCoords = OfficeExcel.getMouseXY(arg);
var mouseX = mouseCoords[0];
var mouseY = mouseCoords[1];
}
var obj = this;
if ( mouseY < obj._chartGutter._top
|| mouseY > (obj.canvas.height - obj._chartGutter._bottom)
|| mouseX < this._chartGutter._left
|| mouseX > (obj.canvas.width - this._chartGutter._right)
) {
return null;
}
if (obj._otherProps._xaxispos == 'center') {
var value = (((obj.grapharea / 2) - (mouseY - obj._chartGutter._top)) / obj.grapharea) * (obj.max - obj.min)
value *= 2;
if (value >= 0) {
value += obj.min
} else {
value -= obj.min
}
} else {
var value = ((obj.grapharea - (mouseY - obj._chartGutter._top)) / obj.grapharea) * (obj.max - obj.min)
value += obj.min;
}
return value;
} }
\ No newline at end of file
...@@ -1299,7 +1299,7 @@ CChartAsGroup.prototype = ...@@ -1299,7 +1299,7 @@ CChartAsGroup.prototype =
if ( !this.chart.range.intervalObject ) if ( !this.chart.range.intervalObject )
this.drawingObjects.intervalToIntervalObject(this.chart); this.drawingObjects.intervalToIntervalObject(this.chart);
this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0)); this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.brush.fill.RasterImageId = ""; this.brush.fill.RasterImageId = "";
this.updateDrawingBaseCoordinates(); this.updateDrawingBaseCoordinates();
//this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId); //this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
...@@ -1646,7 +1646,7 @@ CChartAsGroup.prototype = ...@@ -1646,7 +1646,7 @@ CChartAsGroup.prototype =
if ( !this.chart.range.intervalObject ) if ( !this.chart.range.intervalObject )
this.drawingObjects.intervalToIntervalObject(this.chart); this.drawingObjects.intervalToIntervalObject(this.chart);
this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0)); this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.brush.fill.RasterImageId = ""; this.brush.fill.RasterImageId = "";
//this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId); //this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
}, },
......
...@@ -493,7 +493,7 @@ CImageShape.prototype = ...@@ -493,7 +493,7 @@ CImageShape.prototype =
this.chart.height = this.drawingDocument.GetDotsPerMM(this.extY); this.chart.height = this.drawingDocument.GetDotsPerMM(this.extY);
var chartRender = new ChartRender(); var chartRender = new ChartRender();
var chartBase64 = chartRender.insertChart(this.chart, null, this.chart.width, this.chart.height); var chartBase64 = chartRender.insertChart(this.chart, this.chart.width, this.chart.height);
this.chart.img = chartBase64; this.chart.img = chartBase64;
this.setRasterImage(this.chart.img); this.setRasterImage(this.chart.img);
editor.WordControl.m_oLogicDocument.DrawingObjects.urlMap.push(this.chart.img); editor.WordControl.m_oLogicDocument.DrawingObjects.urlMap.push(this.chart.img);
...@@ -503,7 +503,7 @@ CImageShape.prototype = ...@@ -503,7 +503,7 @@ CImageShape.prototype =
var chartRender = new ChartRender(); var chartRender = new ChartRender();
var width_pix = this.drawingDocument.GetDotsPerMM(this.absExtX); var width_pix = this.drawingDocument.GetDotsPerMM(this.absExtX);
var heght_pix = this.drawingDocument.GetDotsPerMM(this.absExtY); var heght_pix = this.drawingDocument.GetDotsPerMM(this.absExtY);
var chartBase64 = chartRender.insertChart(this.chart, null, width_pix, heght_pix); var chartBase64 = chartRender.insertChart(this.chart, width_pix, heght_pix);
if ( !chartBase64 ) if ( !chartBase64 )
return; return;
......
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