Commit 243a84e2 authored by Sergey Luzyanin's avatar Sergey Luzyanin

method SetLegendFontSize was added to ApiChart

parent ac2ed341
......@@ -1006,6 +1006,15 @@
AscFormat.builder_SetChartLegendPos(this.Chart, sLegendPos);
};
/**
* Specifies a legend position
* @number nFontSize
* */
ApiChart.prototype.SetLegendFontSize = function(nFontSize)
{
AscFormat.builder_SetLegendFontSize(this.Chart, nFontSize);
};
/**
* Spicifies a show options for data labels
* @param {boolean} bShowSerName
......@@ -1099,6 +1108,7 @@
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
......
......@@ -10090,6 +10090,30 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function builder_SetLegendFontSize(oChartSpace, nFontSize){
var oLegend = oChartSpace.chart.legend;
if(oLegend){
if(!oLegend.txPr)
{
oLegend.setTxPr(new AscFormat.CTextBody());
}
if(!oLegend.txPr.bodyPr)
{
oLegend.txPr.setBodyPr(new AscFormat.CBodyPr());
}
if(!oLegend.txPr.content)
{
oLegend.txPr.setContent(new AscFormat.CDrawingDocContent(oLegend.txPr, oChartSpace.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
var oPr = oLegend.txPr.content.Content[0].Pr.Copy();
if(!oPr.DefaultRunPr){
oPr.DefaultRunPr = new AscCommonWord.CTextPr();
}
oPr.DefaultRunPr.FontSize = nFontSize;
oLegend.txPr.content.Content[0].Set_Pr(oPr);
}
}
function builder_SetShowDataLabels(oChartSpace, bShowSerName, bShowCatName, bShowVal, bShowPerecent){
if(oChartSpace && oChartSpace.chart && oChartSpace.chart.plotArea && oChartSpace.chart.plotArea.charts[0]){
var oChart = oChartSpace.chart.plotArea.charts[0];
......@@ -10355,6 +10379,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat'].builder_SetChartHorAxisMinorTickMark = builder_SetChartHorAxisMinorTickMark;
window['AscFormat'].builder_SetChartVerAxisMajorTickMark = builder_SetChartVerAxisMajorTickMark;
window['AscFormat'].builder_SetChartVerAxisMinorTickMark = builder_SetChartVerAxisMinorTickMark;
window['AscFormat'].builder_SetLegendFontSize = builder_SetLegendFontSize;
......
......@@ -672,6 +672,14 @@
AscFormat.builder_SetChartLegendPos(this.Chart, sLegendPos);
};
/**
* Specifies a legend position
* @number nFontSize
* */
ApiChart.prototype.SetLegendFontSize = function(nFontSize)
{
AscFormat.builder_SetLegendFontSize(this.Chart, nFontSize);
};
/**
* Specifies a vertical axis orientation
......@@ -800,6 +808,7 @@
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
......
......@@ -4052,6 +4052,15 @@
}
};
/**
* Specifies a legend position
* @number nFontSize
* */
ApiChart.prototype.SetLegendFontSize = function(nFontSize)
{
AscFormat.builder_SetLegendFontSize(this.Chart, nFontSize);
};
/**
* Spicifies a show options for data labels
* @param {boolean} bShowSerName
......@@ -4473,6 +4482,7 @@
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
......
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