Commit 139c5874 authored by SergeyLuzyanin's avatar SergeyLuzyanin

SetShowPointDataLabel

parent 46595789
......@@ -1115,6 +1115,21 @@
{
AscFormat.builder_SetShowDataLabels(this.Chart, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies a show options for data labels
* @param {number} nSeriesIndex
* @param {number} nPointIndex
* @param {boolean} bShowSerName
* @param {boolean} bShowCatName
* @param {boolean} bShowVal
* @param {boolean} bShowPercent
* */
ApiChart.prototype.SetShowPointDataLabel = function(nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent)
{
AscFormat.builder_SetShowPointDataLabel(this.Chart, nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
......@@ -1254,6 +1269,7 @@
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetShowPointDataLabel"] = ApiChart.prototype.SetShowPointDataLabel;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
......
......@@ -10298,6 +10298,56 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetObjectFontSize(oChartSpace.chart.plotArea.getVerticalAxis(), nFontSize, oChartSpace.getDrawingDocument());
}
function builder_SetShowPointDataLabel(oChartSpace, nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPerecent){
if(oChartSpace && oChartSpace.chart && oChartSpace.chart.plotArea && oChartSpace.chart.plotArea.charts[0]){
var oChart = oChartSpace.chart.plotArea.charts[0];
var bPieChart = oChart.getObjectType() === AscDFH.historyitem_type_PieChart || oChart.getObjectType() === AscDFH.historyitem_type_DoughnutChart;
var ser = oChart.series[nSeriesIndex];
if(ser){
{
if(!ser.dLbls){
if(oChart.dLbls){
ser.setDLbls(oChart.dLbls.createDuplicate());
}
else{
ser.setDLbls(new AscFormat.CDLbls());
ser.dLbls.setSeparator(",");
ser.dLbls.setShowSerName(false);
ser.dLbls.setShowCatName(false);
ser.dLbls.setShowVal(false);
ser.dLbls.setShowLegendKey(false);
if(bPieChart){
ser.dLbls.setShowPercent(false);
}
ser.dLbls.setShowBubbleSize(false);
}
}
var dLbl = ser.dLbls.findDLblByIdx(nPointIndex);
if(!dLbl)
{
dLbl = new AscFormat.CDLbl();
dLbl.setIdx(nPointIndex);
if(ser.dLbls.txPr)
{
dLbl.merge(ser.dLbls);
}
ser.dLbls.addDLbl(dLbl);
}
dLbl.setSeparator(",");
dLbl.setShowSerName(true == bShowSerName);
dLbl.setShowCatName(true == bShowCatName);
dLbl.setShowVal(true == bShowVal);
dLbl.setShowLegendKey(false);
if(bPieChart){
dLbl.setShowPercent(true === bShowPerecent);
}
dLbl.setShowBubbleSize(false);
}
}
}
}
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];
......@@ -10609,6 +10659,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat'].builder_SetVerAxisMinorGridlines = builder_SetVerAxisMinorGridlines;
window['AscFormat'].builder_SetHorAxisFontSize = builder_SetHorAxisFontSize;
window['AscFormat'].builder_SetVerAxisFontSize = builder_SetVerAxisFontSize;
window['AscFormat'].builder_SetShowPointDataLabel = builder_SetShowPointDataLabel;
......
......@@ -784,6 +784,20 @@
AscFormat.builder_SetShowDataLabels(this.Chart, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies a show options for data labels
* @param {number} nSeriesIndex
* @param {number} nPointIndex
* @param {boolean} bShowSerName
* @param {boolean} bShowCatName
* @param {boolean} bShowVal
* @param {boolean} bShowPercent
* */
ApiChart.prototype.SetShowPointDataLabel = function(nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent)
{
AscFormat.builder_SetShowPointDataLabel(this.Chart, nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
......@@ -942,6 +956,7 @@
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetShowPointDataLabel"] = ApiChart.prototype.SetShowPointDataLabel;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
......
......@@ -4245,6 +4245,20 @@
};
/**
* Spicifies a show options for data labels
* @param {number} nSeriesIndex
* @param {number} nPointIndex
* @param {boolean} bShowSerName
* @param {boolean} bShowCatName
* @param {boolean} bShowVal
* @param {boolean} bShowPercent
* */
ApiChart.prototype.SetShowPointDataLabel = function(nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent)
{
AscFormat.builder_SetShowPointDataLabel(this.Chart, nSeriesIndex, nPointIndex, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
......@@ -4714,6 +4728,7 @@
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetLegendFontSize"] = ApiChart.prototype.SetLegendFontSize;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetShowPointDataLabel"] = ApiChart.prototype.SetShowPointDataLabel;
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