We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Category Axis Label Not Showing


I have generated graph using aspose cell. Its generated graph, but not showing Category Axis label. It showing default value like 1, 2, etc…

It also not showing Legend on Top position, although I have set is.

My code like following…

Chart chart = charts.get(chartIndex);
SeriesCollection nSeries = chart.getNSeries();
CategorySeries= dataSheet+ “!C”+(rowStartPos+1)+":I"+(rowStartPos+1)+"";
String vSeries=“C”+ (rowStartPos+2) +":I"+(rowEndPos+1);


//Format Plot Area
ChartFrame plotArea = chart.getPlotArea();
Area area = plotArea.getArea();

//Format Title
Title title = chart.getTitle();
com.aspose.cells.Font font = title.getFont();

//Hide Legend
Legend legend = chart.getLegend();

Please suggest, what I am missing
Thanks in advance…
Sanjay Kumar Mishra

Hi Sanjay,

Thank you for contacting Aspose support.

I believe there could be a problem with your current version of the Aspose.Cells APIs which isn’t allowing to get correct/desired results. I would suggest you to give a try to the latest revision of the API, that is; Aspose.Cells for Java (Latest Version) at the moment. Please note, I have simply executed the following piece of code to show the legend of the Chart 1 on top and it seem to have fixed the problem related to the Category Axis labels as well.

In case the problem persists with latest revision, please provide us an executable sample application covering your complete scenario (generation of chart as well) along with your desired results that you may create manually in Excel application to show what you exactly require to achieve with Aspose.Cells APIs.


Workbook book = new Workbook(dir + “KPI+Dashboard.xlsx”);
Worksheet sheet = book.getWorksheets().get(0);
ChartCollection charts = sheet.getCharts();
Chart chart = charts.get(“Chart 1”);
book.save(dir + “output.xlsx”);

Hi Babar,

Thanks for your quick response. As per your instruction, I have updated my API with 8.7.1.

For my first problem, it works like charm, and it solve my first problem.

But for my second problem - Legend not showing on top, its not working. When I put chart.calculate(), its throws error like:

java.lang.NumberFormatException: Input string was not in a correct format: CEll Availability
at com.aspose.cells.b.a.ze.g(Unknown Source)
at com.aspose.cells.zbt.a(Unknown Source)
at com.aspose.cells.zim.a(Unknown Source)
at com.aspose.cells.zim.b(Unknown Source)
at com.aspose.cells.zis.an(Unknown Source)
at com.aspose.cells.zka.d(Unknown Source)
at com.aspose.cells.ziq.b(Unknown Source)
at com.aspose.cells.ziq.a(Unknown Source)
at com.aspose.cells.Chart.a(Unknown Source)
at com.aspose.cells.Chart.calculate(Unknown Source)

where is in legend, there is text.

Please suggest.
Sanjay Kumar Mishra

Hi Sanjay.

As per company policy, we have to replicate the issue with latest revision of the API before logging it in our database. As per my testing, I am not getting any exception on Chart.calculate method while using the latest revision, which is Aspose.Cells for Java (Latest Version) at the moment. You have upgraded to 8.7.1 therefore I would request to give the latest version ( a try on your side. In case the problem persists, we need an executable copy of your application along with input spreadsheet, if different than already shared sample. Please also provide your environment details as follow for thorough investigation.

  • Operating system version & architecture
  • JDK vendor, version & architecture
  • JVM arguments, if any
  • Locale of your machine

Thank you for your understanding.