Issues with rendering and saving charts

Hi,

I have problems with the chart from the file Chart.xlsx in two situations:

  • When it is saved in a new file using Aspose Cells (ChartAspose.xlsx )
  1. the labels from the series “Hidden” (“Percent 36.3%” and “Percent 38.0%”) are not placed in the correct location;
  2. the font color is not preserved (both become black).
  3. the white line marking the series is not rendered correctly (it becomes a undefined geometrical figure)

  • When it is rendered as a image (ChartImage.xlsx)
  1. the labels from the series “Hidden” (“Percent 36.3%” and “Percent 38.0%”) are not placed in the correct location;
  2. the white line marking the series is not rendered correctly (it becomes a undefined geometrical figure)
The code used to obtain is this:
var workbook = new Workbook(@“C:\desktop\Chart.xlsx”);
var opts = new ImageOrPrintOptions
{
Quality = 100,
HorizontalResolution = 200,
VerticalResolution = 200,
ImageFormat = ImageFormat.Png
};

var chart = workbook.Worksheets[0].Charts[0];

using (var chartImage = chart.ToImage(opts))
{
chartImage.Save(@“C:\ChartImage.png”);
}

workbook.Save(@“C:\ChartAspose.xlsx”);

Thank you,
Lucian Nistor

Hi,


Thanks for the sample code and template files.

1) When it is rendered as a image (ChartImage.xlsx)
The labels from the series “Hidden” (“Percent 36.3%” and “Percent 38.0%”) are not placed in the correct location;
The white line marking the series is not rendered correctly (it becomes a undefined geometrical figure)

I can notice the issue when rendering chart to image as you have mentioned. I have logged a ticket with an id “CELLSNET-41445” for your issue. We will look into it soon.

2) When it is saved in a new file using Aspose Cells (ChartAspose.xlsx )
The labels from the series “Hidden” (“Percent 36.3%” and “Percent 38.0%”) are not placed in the correct location;
The font color is not preserved (both become black).
The white line marking the series is not rendered correctly (it becomes a undefined geometrical figure)

I can notice the issue as well when re-saving the template file regarding chart as you have mentioned. I have logged a ticket with an id “CELLSNET-41446” for your issue. We will also look into it soon.

Sample code:

var workbook = new Workbook(@“C:\desktop\Chart.xlsx”);
var opts = new ImageOrPrintOptions
{
Quality = 100,
HorizontalResolution = 200,
VerticalResolution = 200,
ImageFormat = ImageFormat.Png
};

var chart = workbook.Worksheets[0].Charts[0];

using (var chartImage = chart.ToImage(opts))
{
chartImage.Save(@“C:\ChartImage.png”);
}

workbook.Save(@“C:\ChartAspose.xlsx”);


Once we have any update on any of the issue, we will let you know here.

Thank you.

Hi,

Please download and try this fix: Aspose.Cells for .NET v7.4.2.3

We support picture marker for line charts. But the data labels still are black. We could not find the cause of the issues.

Thank you.

The white line it is displayed but it is longer than the series rectangle (it overlaps the neighboring series rectangle). I’ve tested this with Aspose 7.4.3.1.

Regards,
Lucian Nistor

Hi,


Yes, I am afraid, your issue logged as “CELLSNET-41446” is not fixed yet. I have tested and found the labels’ overlapping issue as you pointed out. I have logged your comments against your issue into our database. Once we have any update on it, we will let you know here.

Sorry for any inconvenice caused!

Please try our latest version Aspose.Cells 21.6.0.

If you find any issue, please provide the source Excel file to help us analyze it.