Commit 115c68aa 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@47417 954022d7-b5bf-4e40-9824-e11837661b57
parent 6ff60e48
......@@ -12,6 +12,8 @@ function ChartRender() {
else
g_bChartPreview = false;
if (chart.worksheet && !OfficeExcel.drawingCtxCharts)//выставление контекста для отрисовки
OfficeExcel.drawingCtxCharts = chart.worksheet.getDrawingContextCharts();
chartCanvas = document.createElement('canvas');
$(chartCanvas).css('width', width);
$(chartCanvas).css('height', height);
......@@ -437,7 +439,7 @@ function calcGutter(axis,min,max,ymin,ymax,isSkip,isFormatCell) {
}
}
}
//ширины самих линий графика
function calcWidthGraph() {
if ( !chartCanvas )
......@@ -630,10 +632,13 @@ function calcAllMargin(isFormatCell,isformatCellScOy,minX,maxX,minY,maxY, chart)
if(bar._xAxisTitle._text != '' && (min >= 0 || bar.type == 'hbar') && bar._otherProps._xlabels)
bottom += 7;
}
bar._chartGutter._left = standartMargin + left;
bar._chartGutter._right = standartMargin + right;
bar._chartGutter._top = standartMargin + top;
bar._chartGutter._bottom = bottom + standartMargin;
var scale = 1;
if(OfficeExcel && OfficeExcel.drawingCtxCharts)
scale = OfficeExcel.drawingCtxCharts.scaleFactor;
bar._chartGutter._left = (standartMargin + left)*scale;
bar._chartGutter._right = (standartMargin + right)*scale;
bar._chartGutter._top = (standartMargin + top)*scale;
bar._chartGutter._bottom = (bottom + standartMargin)*scale;
}
//-----------------------------------------------------------------------------------
......@@ -2031,7 +2036,4 @@ function setFontChart(chart)
bar._otherProps._text_font = defaultFont;
bar._otherProps._text_size = defaultSize;
}
if (chart.worksheet)//выставление контекста для отрисовки
bar.drawingCtxCharts = chart.worksheet.getDrawingContextCharts();
}
......@@ -1498,7 +1498,7 @@
*/
OfficeExcel.Text = function (context, font, size, x, y, text)
{
var drwContext = bar.drawingCtxCharts;
var drwContext = OfficeExcel.drawingCtxCharts;
if(drwContext)
{
drwContext.setCanvas(bar.canvas);
......@@ -1572,7 +1572,8 @@
context.setFillStyle(arguments[13].color);
else
context.setFillStyle("#000000");
x = x/(drwContext.scaleFactor);
y = y/(drwContext.scaleFactor);
// Rotate the canvas if need be
if (arguments[9] && textSize) {
var textOptions =
......@@ -1588,7 +1589,7 @@
if(!arguments[9])
{
context.fillText(text, x*0.75, y*0.75, undefined, [6.36474609375]);
context.fillText(text, x*0.75, y*0.75);
context.lineWidth = 1;
}
context.restore();
......
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