I would like to be able to show the data labels on a chart that I’ve set the pivot source for. I know that you can usually do this via the Chart.NSeries.DataLabels.ShowValue property. However, because the chart is a PivotChart (Chart.PivotSource = “”), my NSeries collection is empty. How can I control the look and feel of the series on my PivotChart?
I am afraid, the feature is not supported yet.
We have recently supported to manipulate pivot tables in v5.2.0 of the product, so now we can start working on your feature (manipulating pivot charts). We already added the feature into our issue tracking system with an id: CELLSNET-16205. Once we have any update about it, we will let you know.
Do we now have any way to display Data labels on pivot charts?
Please change your sample code as following.
See the highlighted line.
PivotTable pvt = workbook.Worksheets.PivotTables;
Chart chart = workbook.Worksheets.Charts;
chart.RefreshPivotData();//add this code
chart.NSeries.DataLabels.ShowValue = true; //Error
For this I need to first save the excel with pivot chart and then open it to use its DataLabel.ShowValue property, can’t this be done without saving the file, as my requirement is to use a template and create the resultant file on the fly?