Problems with complex bar chart

Hello,

I'm having a problem with charts in Aspose that I must resolve.

I am working with an Excel 2010 .xltx file that has a chart with horizontal bars and a vertical axis that is centered on 100 rather than 0. I am using Aspose to update the cells that the chart is based on, and expecting the chart to reflect the new values when I open it in Excel. However, the chart fails to shade any of the bars that are to the left of the vertical axis. The attached image files Original.png and AfterAspose.png illustrate this. Note that in this test the only Aspose.Cells code used was:

   workbook = new Workbook(path);   
   workbook.Save(pathSave, SaveFormat.Xlsx);
 

Ultimately I want to shade the bars based on the values in the Index column, but currently the following code to shade the bars has no effect on the bars to the left of the vertical axis:

      Chart chart = worksheet.Charts[0];
if (chart == null)
return;

SeriesCollection NSeries = chart.NSeries;
if (NSeries.Count < 1) return;

Series series = NSeries[0];
ChartPointCollection points = series.Points;
foreach (ChartPoint point in points)
{
point.Area.ForegroundColor = Color.Blue;// rangeColors[rangeIndex].Color;//workbook.Colors[paletteIndex + rangeIndex];
}
 
 

If I examine the Chart1.xml file in the Excel xlsx package, I can see that lines that were originally:


become

and the lines like


become

Note that the vertical axis was set up to cross at 100 on the x-axis, but the following code change takes place:

// Original

// Final.

I have attached the original Excel file and the final file that was opened and saved by Aspose. The files were created using VSTO, so you might get some prompts about the VSTO application not being found, but I think you should be able to ignore the prompts. I can create a simpler example to illustrate the problem if necessary.





Hi,

Thanks for providing us the sample files.

I tried using our latest version/fix v5.3.0.6, it works fine. Please try Aspose.Cells for .NET v5.3.0.6.

I have used your template file with the following code, it works fine. I have also attached the output file.

Sample code:
Workbook workbook = new Workbook(“e:\test2\PRIZM+Report1.xlsx”);

//Ultimately I want to shade the bars based on the values in the Index column, but currently the following code to shade the bars has no effect on the bars to the left of the vertical axis:

Chart chart = workbook.Worksheets[1].Charts[0];
if (chart == null)
return;
SeriesCollection NSeries = chart.NSeries;
if (NSeries.Count < 1) return;
Series series = NSeries[0];
ChartPointCollection points = series.Points;
foreach (ChartPoint point in points)
{
point.Area.ForegroundColor = Color.Blue;// rangeColors[rangeIndex].Color;
// workbook.Colors[paletteIndex + rangeIndex];
}
workbook.Save(“e:\test2\output_PRIZM+Report1.xlsx”);

Thank you.

Hi Amjad,

I looked at your output file in Excel 2010 and there didn't seem to be a difference from the original -- the bars to the left of the vertical axis were still all white/blank. However, I then looked at it with Excel 2007 and you are right, the chart does display as expected in that application.

The problem does seem to be with Aspose since the original xlxt file displays fine in both Excel 2007 and 2010 until it has been opened and saved with Aspose.Cells. After that, it only displays properly in Excel 2007. Could you please look at the problem again with Excel 2010 and let me know what you find.

Thanks,

Sig Isaac

Hi,

Thanks for your feedback and further details.

We will investigate the issue as the generated file does not show proper display for the chart in Excel 2010 where as it displays just fine in Excel 2007.
I have logged a ticket for the issue with id:
CELLSNET-25229. We will look into this matter whether it is an issue or something else.

Thank you.

Hi,

Please try the Aspose.Cells for .NET v5.3.1.1. We have fixed the issue now.

Thank you.

That fix is looking good. Thank you very much for the quick response.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan