We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to change Series color from a pivot Chart

sheet3.Charts[index].NSeries[0].Area.ForegroundColor = Color.Blue;
is not working rather throwing error.it works in a normal chart that where i can get all the series and change there colors programmatically but doesnt work in pivot chart. The Nseries is returning count of 0 but the plot is showing when downloaded and excel using it defaults series color.


Please download and try the latest fix/version: Aspose.Cells for .NET (Latest Version). It works fine as I have tested with it. I used a template file (attached) which already has a pivot table and pivot chart. I refresh the pivot table and its data accordingly, get the chart object, now change the foreground color of the first series and then re-save the file (attached), it works fine.

Please see the sample code for your reference:

Sample code:

Workbook workbook = new Workbook(“e:\test2\my_pvtchart.xls”);

PivotTable pvt = workbook.Worksheets[0].PivotTables[0];



Chart chart = workbook.Worksheets[1].Charts[0];


chart.NSeries[0].Area.ForegroundColor = Color.Yellow;


Thank you.