We are having a problem with Chart.ToImage(). For some charts it generates extra values so it modifies the chart altogether.
Here is the following code used to reproduce the issue (along with the attached file):
var workbook = new Workbook(“testFile.xlsx”);
var worksheet = workbook.Worksheets;
const string chartName = “name”;
var chart = worksheet.Charts.FirstOrDefault(x => chartName.Equals(x.Name, StringComparison.OrdinalIgnoreCase));
if (chart == null)
workbook.FileFormat = FileFormatType.Xlsx;
var image = chart.ToImage(new ImageOrPrintOptions
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
Thanks for your posting and using Aspose.Cells.
We have generated the chart image by using your sample code with the latest version Aspose.Cells
for .NET v126.96.36.199 and were able to observe the issue partially. We now need your favor to download the chart image attached with this post and mark the issue(s) with red circles. This will help us look into your issues more precisely and closely and we will be able to fix it quickly. Thanks for your cooperation in this regard.
Sorry for not posting it the first time. I have marked the issues with red circles and one square (for multiple issues).
Thanks for highlighting this issue nicely, we appreciate it and and using Aspose.Cells.
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-43978 - Chart to image is generated with extra values
Thanks for using Aspose.Cells.
Please try the new fix for extra data labels.
Please download and try the latest fix: Aspose.Cells
for .NET v188.8.131.52 and let us know your feedback.