Aspose 8.4.2 reads chart properties incorrectly

Hi,


If you compare,

- NSeries[0], NSeries[1] properties using Aspose 8.4.1 and 8.4.2 of sample1
- NSeries[0].Area.ForegroundColor, NSeries[1].Area.ForegroundColor , NSeries[2].Area.ForegroundColor of sample2 using Aspose 8.4.1 and 8.4.2 ; you’ll find that the properties are being read in correctly in the later version.

I have attached the respective results.Please look into this.

Thanks!

Hi Yashali,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v8.4.2.1
and see if it makes any difference and resolves your issue.

If your issue still occurs, then please provide us your sample project illustrating your issue in detail. It will help us look into your issue more closely and precisely and we will be able to help you asap.

Hi,


I need Aspose Cells for .NET 3.5 and above, please

Thanks

Hi Yashali,

Thanks for your posting and using Aspose.Cells.

We are afraid, 3.5 and above version is not available at this moment. Kindly provide us your sample project with the v8.4.1 and v8.4.2. It will be helpful for us to investigate the issue. Thanks for cooperation.

Hi,


The issue is with Aspose 8.4.2 reading the chart properties incorrectly.

I have attached the sample excel files and the properties read out of them using two versions of aspose.

As you can see from the attachments, 8.4.1 reads correct values of DrawingArea.ForegroundColor of NSeries[0] and NSeries[1] of the sample2 workbook and 8.4.2 swaps the values of DrawingArea.ForegroundColor of NSeries[0] and NSeries[1] i.e,

Using 8.4.1,

NSeries[1].Area.ForegroundColor: "{Name=7fa2bc, ARGB=(0, 127, 162, 188)}"

NSeries[2].Area.ForegroundColor: "{Name=e8343e, ARGB=(0, 232, 52, 62)}"

While using 8.4.2 (incorrrect, swapped),

NSeries[1].ForegroundColor: "{Name=e8343e, ARGB=(0, 232, 52, 62)}"

NSeries[2].ForegroundColor: “{Name=7fa2bc, ARGB=(0, 127, 162, 188)}”


Similarly for sample1,

using 8.4.1,

NSeries[0].Type = Line

NSeries[1].Type = Area

whereas using 8.4.2 (incorrect swapped),

NSeries[0].Type = Area

NSeries[1].Type = Line


In fact, all the series properties read for sample1 are read incorrectly by 8.4.2


Thanks

Hi,


Sample code to display the properties being read incorrectly (To be run with 8.4.1 first and then with 8.4.2 and compared)


Workbook workbook1 = new Workbook(“C:\sample1.xlsm”);
Workbook workbook2 = new Workbook(“C:\sample2.xlsm”);

Console.WriteLine(“wb2 foreground color Nseries1” + workbook2.Worksheets[0].Charts[0].NSeries[1].Area.ForegroundColor);
Console.WriteLine(“wb2 foreground color Nseries2” + workbook2.Worksheets[0].Charts[0].NSeries[2].Area.ForegroundColor);

Console.WriteLine(“wb1 series type Nseries0” + workbook1.Worksheets[0].Charts[0].NSeries[0].Type);
Console.WriteLine(“wb1 series type Nseries1” + workbook1.Worksheets[0].Charts[0].NSeries[1].Type); // Series properties are all swapped and read

Console.Read();

Hi,

Thanks for your sample code and explanation and using Aspose.Cells.

We were able to observe this issue and found that latest version reads the properties in reverse and these properties are swapped.

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-43683 - Aspose 8.4.2 reads chart properties incorrectly and are swapped

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells
for .NET v8.4.2.7
and let us know your feedback.

By default, the series in SeriesCollection are ordered by the order in the excel file.

Please try the new fix. We provide a new method GetSeriesByOrder(int) for your requirement.

C#

string path = @"D:\Aspose\User\1004";

Workbook workbook1 = new Workbook(path + “sample1.xlsm”);

Workbook workbook2 = new Workbook(path + “sample2.xlsm”);

Series series0 = workbook2.Worksheets[0].Charts[0].NSeries.GetSeriesByOrder(0);

Console.WriteLine("wb2 name Nseries0 : " + series0.DisplayName);

Console.WriteLine("wb2 foreground color Nseries0 : " + series0.Area.ForegroundColor);

Series series1 = workbook2.Worksheets[0].Charts[0].NSeries.GetSeriesByOrder(1);

Console.WriteLine("wb2 name Nseries1 : " + series1.DisplayName);

Console.WriteLine("wb2 foreground color Nseries1 : " + series1.Area.ForegroundColor);

Series series2 = workbook2.Worksheets[0].Charts[0].NSeries.GetSeriesByOrder(2);

Console.WriteLine("wb2 name Nseries2 : " + series2.DisplayName);

Console.WriteLine("wb2 foreground color Nseries2 : " + series2.Area.ForegroundColor);

series0 = workbook1.Worksheets[0].Charts[0].NSeries.GetSeriesByOrder(0);

Console.WriteLine("wb1 series name Nseries0 : " + series0.DisplayName);

Console.WriteLine("wb1 series type Nseries0 : " + series0.Type);

series1 = workbook1.Worksheets[0].Charts[0].NSeries.GetSeriesByOrder(1);

Console.WriteLine("wb1 series name Nseries1 : " + series1.DisplayName);

Console.WriteLine("wb1 series type Nseries1 : " + series1.Type);

The issues you have found earlier (filed as CELLSNET-43683) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi,

I appreciate the fix that you have provided. It works as you demonstrated.

Here's another scenario where the problem persists in Aspose Cells for .Net version 8.6.0 (.NET 3.5 and above) as well :

Workbook workbook1 = new Workbook(@"C:\sample1.xlsm");
Series[] copyType = new Series[2];
workbook1.Worksheets[0].Charts[0].NSeries.CopyTo(copyType);

Console.WriteLine("copyType[0] series type Nseries[0] " + copyType[0].Type);
Console.WriteLine("copyType[1] series type Nseries[1] " + copyType[1].Type);

Workbook workbook2 = new Workbook(@"C:\sample2.xlsm");

Series[] copyColor = new Series[3];
workbook2.Worksheets[0].Charts[0].NSeries.CopyTo(copyColor);

Console.WriteLine("copyColor[1] series Color Nseries[1] " + copyColor[1].Area.ForegroundColor);
Console.WriteLine("copyColor[2] series Color Nseries[2] " + copyColor[2].Area.ForegroundColor);

Console.Read();

Compare the outputs using version 8.4.1 and versions (8.4.2 to 8.6.0)


output with version 8.6.0 :

copyType[0] series type Nseries[0] Area
copyType[1] series type Nseries[1] Line
copyColor[1] series Color Nseries[1] Color [A=0, R=232, G=52, B=62]
copyColor[2] series Color Nseries[2] Color [A=0, R=127, G=162, B=188]


output with version 8.4.1 :

copyType[0] series type Nseries[0] Line
copyType[1] series type Nseries[1] Area
copyColor[1] series Color Nseries[1] Color [A=0, R=127, G=162, B=188]
copyColor[2] series Color Nseries[2] Color [A=0, R=232, G=52, B=62]


Thanks

Hi,

Thanks for your posting, appreciating and using Aspose.Cells.

We have tested this code with the latest version 8.6.0 and the older version 8.4.1 and the results match as you have shown in your post.

Please explain in detail why 8.4.1 result is correct than 8.6.0 so that we could log this issue in our database for investigation and fix. Thanks for your cooperation.

Hi,


The outputs of 8.4.1 and earlier versions are correct. All you have to do to check is open the workbooks and see how the series type is ‘line’ for NSeries[0] of sample1.xlsm etc.

Thanks

Hi,

Thanks for your clarification and using Aspose.Cells.

We were able to observe this issue and logged it in our database for investigation. We will look into it and fix this issue if possible. Once there is some fix or other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43956 - Chart properties later than v8.4.1 are read incorrectly

Hi,

Thanks for using Aspose.Cells.

We have applied new rule for series collection later than v8.4.1. Actually, we think the older version is incorrect.

For your requirement, you must call new method SeriesCollection.GetSeriesByOrder(int). It should fix your issue. Let us know your feedback.

Please see the screenshot for more clarification of this issue.

I can see what’s happening now! Thanks I used the new method. It works fine!

Hi,


Good to know that your issue is sorted out now. Feel free to contact us any time if you have further queries or issue, we will be happy to assist you soon.

Thank you.