Commit 009d7741 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

прозрачный фон диаграммы(для презентаций)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49660 954022d7-b5bf-4e40-9824-e11837661b57
parent aa073544
......@@ -1363,6 +1363,9 @@ function drawChart(chart, arrValues, width, height, options) {
var defaultYTitle = api_sheet ? api_sheet.chartTranslate.yAxis : api_doc.chartTranslate.yAxis;
var defaultTitle = api_sheet ? api_sheet.chartTranslate.title : api_doc.chartTranslate.title;
var inheritColor = "inherit";
var defaultColor = "white";
if(OfficeExcel.drawingCtxCharts)
OfficeExcel.drawingCtxCharts.setCanvas(chartCanvas);
// По типу
......@@ -1637,6 +1640,15 @@ function drawChart(chart, arrValues, width, height, options) {
setFontChart(chart);
calcAllMargin(chart.isFormatCell,chart.isformatCellScOy,chart.min,chart.max,chart.ymin,chart.ymax, chart);
calcWidthGraph();
if(options)
{
bar._otherProps._background_barcolor1 = inheritColor;
bar._otherProps._background_barcolor2 = inheritColor;
bar._otherProps._background_image_color = inheritColor;
}
else
bar._otherProps._background_image_color = defaultColor;
bar.Draw(chart.min,chart.max,chart.ymin,chart.ymax,chart.isSkip,chart.isFormatCell,chart.isformatCellScOy);
}
......
......@@ -129,7 +129,7 @@
this.halfTextHeight = this._otherProps._text_size / 2;
//Draw Area
this.DrawArea();
OfficeExcel.background.DrawArea(this);
// Progressively Draw the chart
OfficeExcel.background.Draw(this);
......@@ -254,34 +254,6 @@
}
OfficeExcel.Bar.prototype.DrawArea = function ()
{
// Don't draw the axes?
if (this._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(this);
this.context.lineWidth = 1;
this.context.lineCap = 'butt';
this.context.strokeStyle = this._otherProps._axis_color;
this.context.fillStyle = 'yellow';
this.context.beginPath();
this.context.fillStyle = "white";
this.context.fillRect(0,0,this.canvas.width,this.canvas.height);
// border
if ( !g_bChartPreview && this._otherProps._area_border ) {
this.context.beginPath();
this.context.rect(0, 0, this.canvas.width,this.canvas.height);
this.context.strokeStyle = "black";
}
//this.context.strokeRect(10,10,this.canvas.width-150,this.canvas.height-150)
this.context.stroke();
}
/**
* Draws the charts axes
*/
......
......@@ -3984,4 +3984,34 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
obj.canvas.addEventListener('mousemove', UserMousemoveHandler, false);
OfficeExcel.AddEventListener(obj.id, 'mousemove', UserMousemoveHandler);
}
}
OfficeExcel.background.DrawArea = function (obj)
{
// Don't draw the axes?
if (obj._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(obj);
obj.context.lineWidth = 1;
obj.context.lineCap = 'butt';
obj.context.strokeStyle = obj._otherProps._axis_color;
obj.context.fillStyle = 'yellow';
obj.context.beginPath();
if (typeof(obj._otherProps._background_image) == 'string')
obj.context.fillStyle = "inherit";
else
obj.context.fillStyle = obj._otherProps._background_image_color;
obj.context.fillRect(0,0,obj.canvas.width,obj.canvas.height)
// border
if ( !g_bChartPreview && obj._otherProps._area_border ) {
obj.context.beginPath();
obj.context.rect(0, 0, obj.canvas.width,obj.canvas.height);
obj.context.strokeStyle = "black";
}
obj.context.stroke();
}
\ No newline at end of file
......@@ -169,7 +169,7 @@
//Draw Area
this.DrawArea();
OfficeExcel.background.DrawArea(this);
// Progressively Draw the chart
OfficeExcel.background.Draw(this);
......@@ -397,33 +397,6 @@
OfficeExcel.FireCustomEvent(this, 'ondraw');
}
OfficeExcel.HBar.prototype.DrawArea = function ()
{
// Don't draw the axes?
if (this._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(this);
this.context.lineWidth = 1;
this.context.lineCap = 'butt';
this.context.strokeStyle = this._otherProps._axis_color;
this.context.fillStyle = 'yellow';
this.context.beginPath();
this.context.fillStyle = "white";
this.context.fillRect(0,0,this.canvas.width,this.canvas.height)
//this.context.strokeRect(10,10,this.canvas.width-150,this.canvas.height-150)
// border
if ( !g_bChartPreview && this._otherProps._area_border ) {
this.context.beginPath();
this.context.rect(0, 0, this.canvas.width,this.canvas.height);
this.context.strokeStyle = "black";
}
this.context.stroke();
}
/**
* This draws the axes
*/
......
......@@ -213,7 +213,7 @@
}
//Draw Area
this.DrawArea();
OfficeExcel.background.DrawArea(this);
// Draw 3D
if (this._otherProps._variant == '3d')
......@@ -454,40 +454,6 @@
OfficeExcel.Line.prototype.DrawArea = function ()
{
// Don't draw the axes?
if (this._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(this);
this.context.lineWidth = 1;
this.context.lineCap = 'butt';
this.context.strokeStyle = this._otherProps._axis_color;
this.context.fillStyle = 'yellow';
this.context.beginPath();
if (typeof(this._otherProps._background_image) == 'string')
this.context.fillStyle = "inherit";
else
this.context.fillStyle = "white";
this.context.fillRect(0,0,this.canvas.width,this.canvas.height)
//this.context.strokeRect(10,10,this.canvas.width-150,this.canvas.height-150)
// border
if ( !g_bChartPreview && this._otherProps._area_border ) {
this.context.beginPath();
this.context.rect(0, 0, this.canvas.width,this.canvas.height);
this.context.strokeStyle = "black";
}
this.context.stroke();
}
// Draws the axes
OfficeExcel.Line.prototype.DrawAxes = function (min,max)
{
......
......@@ -105,7 +105,7 @@
}
//Draw Area
this.DrawArea();
OfficeExcel.background.DrawArea(this);
/**
* Draw the title
*/
......@@ -520,34 +520,6 @@
OfficeExcel.FireCustomEvent(this, 'ondraw');
}
OfficeExcel.Pie.prototype.DrawArea = function ()
{
// Don't draw the axes?
if (this._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(this);
this.context.lineWidth = 1;
this.context.lineCap = 'butt';
this.context.strokeStyle = this._otherProps._axis_color;
this.context.fillStyle = 'yellow';
this.context.beginPath();
this.context.fillStyle = "white";
this.context.fillRect(0,0,this.canvas.width,this.canvas.height)
//this.context.strokeRect(10,10,this.canvas.width-150,this.canvas.height-150)
// border
if ( !g_bChartPreview && this._otherProps._area_border ) {
this.context.beginPath();
this.context.rect(0, 0, this.canvas.width,this.canvas.height);
this.context.strokeStyle = "black";
}
this.context.stroke();
}
/**
* Draws a single segment of the pie chart
......
......@@ -210,7 +210,7 @@
this.grapharea = this.canvas.height - this._chartGutter._top - this._chartGutter._bottom;
//Draw Area
this.DrawArea();
OfficeExcel.background.DrawArea(this);
// Progressively Draw the chart
OfficeExcel.background.Draw(this);
......@@ -435,60 +435,6 @@
OfficeExcel.FireCustomEvent(this, 'ondraw');
}
OfficeExcel.Scatter.prototype.DrawArea = function ()
{
// Don't draw the axes?
if (this._otherProps._noaxes)
return;
// Turn any shadow off
OfficeExcel.NoShadow(this);
this.context.lineWidth = 1;
this.context.lineCap = 'butt';
this.context.strokeStyle = this._otherProps._axis_color;
this.context.fillStyle = 'yellow';
this.context.beginPath();
// Draw the X axis
/*if (this._otherProps._noxaxis == false) {
if (this._otherProps._xaxispos == 'center') {
this.context.moveTo(this._chartGutter._left, AA(this, (this.grapharea / 2) + this._chartGutter._top));
this.context.lineTo(this.canvas.width - this._chartGutter._right, AA(this, (this.grapharea / 2) + this._chartGutter._top));
} else if (this._otherProps._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(0, AA(this, this.canvas.height));
this.context.lineTo(this.canvas.width, AA(this, this.canvas.height));
}
}
// Draw the Y axis
if (this._otherProps._noyaxis == false) {
if (this._otherProps._yaxispos == 'left') {
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 );
} else {
this.context.moveTo(AA(this, this.canvas.width - this._chartGutter._right), this._chartGutter._top);
this.context.lineTo(AA(this, this.canvas.width - this._chartGutter._right), this.canvas.height - this._chartGutter._bottom);
}
}*/
this.context.fillStyle = "white";
this.context.fillRect(0,0,this.canvas.width,this.canvas.height)
//this.context.strokeRect(10,10,this.canvas.width-150,this.canvas.height-150)
// border
if ( !g_bChartPreview && this._otherProps._area_border ) {
this.context.beginPath();
this.context.rect(0, 0, this.canvas.width,this.canvas.height);
this.context.strokeStyle = "black";
}
this.context.stroke();
}
/**
* Draws the axes of the scatter graph
*/
......
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