Aspose.Cells.Charts.ChartType.ColumnStacked does not display properly

Hi,

Please, specify how to work with Aspose.Cells.Charts.ChartType.ColumnStacked as when used in the following below code it displays a stached column bar(s) for a given point(s) not properly.

i.e.., for example as shown in the .JPG part of this forum:

For Point "Feb" Series 2011 Value "273.88" is displayed on top of the Series "2010" Point "Feb" value "358.48". It should be displayed properly aligned to the x axis.

Please, refer to the chart graph diagram part of this forum "chart_stackedcolumn_issues.JPG".

The code below illustartes how the "Column Stacked" chart is generated and is part of the .xlsx file::

//Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.ColumnStacked, 5, 6, 30, 19);
Aspose.Cells.Charts.Chart chart1 = worksheet.Charts[chartIndex];
i = 71;
for (int j = 5; j <= 16; j++)
{
worksheet.Cells["F" + i.ToString()].PutValue(Math.Round((Convert.ToDouble(objRow[j].ToString()) / 1000), 2));
worksheet.Cells["F" + i.ToString()].SetStyle(stlDataCell);
i++;
}
i = 71;
for (int j = 17; j <= 28; j++)
{
worksheet.Cells["G" + i.ToString()].PutValue(Math.Round((Convert.ToDouble(objRow[j].ToString()) / 1000), 2));
worksheet.Cells["G" + i.ToString()].SetStyle(stlDataCell);
i++;
}
//Setting the title of a chart
chart1.Title.Text = "Test1";

//Setting the font color of the chart title to blue
chart1.Title.TextFont.Color = Color.Black;
chart1.Title.TextFont.IsBold = true;
chart1.PlotArea.Area.ForegroundColor = System.Drawing.Color.FromArgb(196, 224, 196);
//Adding SeriesCollection (chart data source) to the chart ranging from "A1" cell to "B3"
chart1.NSeries.Add("F71:G82", true);
//Setting the data source for the category data of SeriesCollection
chart1.NSeries.CategoryData = "H71:H82";

Please, specify how to make the stacked column in the chart to display properly for given two series.

Thanks,

Nita.

Hi,

I am afraid, I am unable to understand your question, both images look same to me except they differ in values.

Will you please provide me your current output xls/xlsx file and the expected output xls/xlsx file and also highlight your problem in a screenshot with red circles.

Please also test your problem with the latest version:
Aspose.Cells for .NET v7.0.2.7

Hi Faiz,

Please, go through the word document (342126_issue_details.docx) part of this forum.

Problem: In the word document the chart diagram for Jan Point the 2010 (blue bar) contains value 400.44 and 2011 (red bar) contains value 969.30. Whereas, the values displayed at the bottom of the chart diagram contains 2010 as 400.44 where as 2011 as 568.86 It should have been displaying according to the values displayed for each month and their year(s) in the excel sheet.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Corrected graph should display for Jan Point the 2010 (blue bar) value as 400.44 and 2011 (red bar) value as 568.86.

Please, specify how to correct this issue immediately.

Thanks again.

Nita.

Note: Aspose.cells.dll file version 5.0.0.0 has been used to generate the output. I would be testing the same issue with the latest version v7.0.2.7 little later. But, do test it with this version 5.0.0.0 first as we are using it at more places.

Hi Faiz,

Tested the issue with the Aspose.Cells.dll v7.0.2.7 but it throwed couple of errors regarding Aspose. So, please, specify if a new Aspose.Cells.lic file has to be added as well along with Aspose.Cells.dll v7.0.2.7. If so, please specify details for Aspose.Cells.lic file as well.

Thanks,

Nita.

Hi,

I understood your problem, I will write a test code and check it on my end and update you asap.

You don’t need to change your license relating code and Aspose.Cells.lic file.

Please check subscription expiry date of your license file, if it is to be expired in future than you don’t need a new license file. If it has already expired, then you need a new license file.

Hi,

Please provide me your output xlsx file which you have generated using your code. The one which contains a problematic chart.

Hi Faiz,

Please, review the document "Test_03_Oct_2011_2128669854.xlsx" which contains the graph that has been generated by code.

Thanks,

Nita.

Hi,

Please reattach this file, because I am getting error downloading it.


Attachment: Test_03_Oct_2011_2128669854.xlsx

Hi,

Please ignore my above post. I am able to download the file now.

Hi,

I found all datapoints as rendered in graph chart are correct inside the output file you provided. Please see these screenshots. I did not find any problem.


Hi Faiz,

That's true that all the datapoints are rendered in the graph. But, the actual problem is with respect to the Y axis display for the stacked column i.e.., for instance the series 2011 for Jan is "568.86" but what is seen in the chart is "969.30" which is wrong. Unless this is how the stacked column chart behaves. If so, then please, specify is their any other way we can show this chart in stacked column but display the values correctly when seen with respect to the Y axis.

Please, find the attached file explaining the problem as well.

Thanks,

Nita.

Hi,


I think you should change your chart type to “Clustered Column” for your requirements, i.e. Aspose.Cells.Charts.ChartType.Column


Thank you.