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

Free Support Forum - aspose.com

Chart is not appearing in MS Excel

I have created an .xlsx file using Aspose cell java APIs having charts.
When I opened it with MS EXCEL the charts are not appearing.
But when I opened the same File Using Google Sheets Charts are appearing properly.
I have also inserted sample code below.

SAMPLE CODE:

ChartCollection charts = sheet.getCharts();

int chartIndex = charts.add(ChartType.BAR_STACKED, 5, 0, 15, 5);
Chart chart = charts.get(chartIndex);

SeriesCollection chartDataSeriesCollection = chart.getNSeries();
String chartInputDataRange = “D5:D10”; //no i18n
chartDataSeriesCollection.add(chartInputDataRange , true);

Series pollVotesSeries = chartDataSeriesCollection.get(0);
pollVotesSeries.setXValues(“C5:C10”); //no i18n

// Saving the Excel file
workbook.save(dataDir + “HToCPyramidChart_out.xls”);

Below is appeared chart screenshot:
Screen Shot 2017-08-30 at 8.58.09 PM.png (7.6 KB)

@Arun_kumar36,

Thanks for providing us sample code segment and screenshot.

Please provide us your template Excel file (input file if any) containing the source data for the chart, output Excel file containing the (blank) chart (by Aspose.Cells APIs) and a sample file (containing your desired chart displayed fine, you can create your desired chart in MS Excel manually), we will check it soon.

@Amjad_Sahi
Thanks for taking your time to reply,
I have found the issue,
I had used

PlotArea plotArea =chart.getPlotArea();
plotArea.setX(30);

in my code which set myChart not visible

@Arun_kumar36,

Good to know that you have figured out your issue now. Feel free to write us back if you have further comments or questions, we will be happy to assist you soon.