Sunburst chart with custom fill color and no data labels throws error in ToImage method - Cells .NET

I have a file in Excel with a simple sunburst chart. If I delete the data labels and give a data point a custom color fill, the ToImage method in the Cells .NET library throws a NullReferenceException.Produce.zip (15.1 KB)

The problem began after upgrading from version 19.11 to 20.4, but seems to be affecting version 19.12 and up.

@cargo.insiten,
I can not reproduce it with Aspose.Cells for .NET 20.6 using below code and your template file:

// Instantiating a Workbook object
Workbook workbook = new Workbook(dataDir + @"Produce.xlsx");

// Obtaining the reference of the first worksheet
WorksheetCollection worksheets = workbook.Worksheets;
Worksheet sheet = worksheets[0];

Chart chart = sheet.Charts[0];

//Save the chart image file.
chart.ToImage(dataDir + @"AsposeChartImage.png", System.Drawing.Imaging.ImageFormat.Png);

Output image is attached AsposeChartImage.png (720 Bytes)

Could you please try with latest version and let us know your feedback.

Thank you for your prompt reply @ahsaniqbalsidiqui. It appears the file I linked was somehow not the correct version.Can you please try again with this file? Produce.zip (22.2 KB)

The resulting chart should be a sunburst chart. This workbook contains four charts, one of which is causing the error and is labeled “doesn’t work”. image.png (9.5 KB)

Also there was another issue that prevented us from upgrading to 20.6, but we tried to upgrade to 20.4, but have this issue. I appreciate your help with this.

@cargo.insiten,
We have observed this issue and logged it for further investigation. It is logged as:

CELLSNET-47429 - Sunburst chart with custom fill color and no data labels throws error in ToImage method

1 Like

@cargo.insiten,
This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-47429”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

1 Like

The issues you have found earlier (filed as CELLSNET-47429) have been fixed in Aspose.Cells for .NET v20.7. This message was posted using Bugs notification tool by ahsaniqbalsidiqui