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

Free Support Forum - aspose.com

Chart.RefreshPivotData() - Incorrect Labels/Legend

When calling Chart.RefreshPivotData() on a chart - even without making any changes to data in the underlying PivotTable - causes the output chart labeling to be incorrect.

Using Aspose Cells .NET


Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v8.4.1.2
and see if it makes any difference and fixes this issue.

your issue still occurs, then please provide us your sample code and
source excel file that we could use to replicate this issue at our end.
We will look into it and help you asap.

Unfortunately, the issue persists.

I’ve included the example code and example Excel data.
The image “chartExample.png” is what is produced by Aspose.Cells - which is incorrect.
The image “correct.png” is what should be produced.

Note that the SlicersExample.xlsx may cause issues because of DateTime data as reported in this thread:
PivotTable.RefreshData() - Unable to cast object of type 'System.DateTime' to type 'System.String'

I have removed the DateTime data from the spreadsheet.

Thank You!


Thanks for your files, code and using Aspose.Cells.

We were able to observe this issue after executing your sample code with your source excel file using the latest version: Aspose.Cells
for .NET v8.4.1.3
. The chart created by Aspose.Cells is not like the expected chart which you have provided.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43632 - Pivot Chart is not showing correct data

Please try our latest version/fix: Aspose.Cells for .NET v21.6.3 (attached)
Aspose.Cells21.6.3 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.6.3 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.6.3 For .NetStandard20.Zip (5.5 MB)

Your issue should be fixed in it.
Let us know your feedback.