Hi,
Hi Santhosh,
Hi,
Hi,
Well, I think you misunderstood the category and value axis of the BAR Clustered chart. It is not an issue. The category axis is rendered vertically while the value axis is rendered horizontally. You may confirm this in Excel for your verification. Aspose.Cells works fine and in the same way as MS Excel does. So you need to adjust your code accordingly. E.g you may set:
chart.getCategoryAxis().getTitle().setText(yAxisTitle);
//…
chart.getValueAxis().getTitle().setText(xAxisTitle);
Here is my other test code, I generate ODS and XLS file that looks fine and identical regarding x-axis and y-axis titles.
Sample code:
Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().getSheet(0);
Cells cells = sheet.getCells();
Cell cell;
cell = cells.getCell(0, 0);
cell.setValue(“value A”);
cell = cells.getCell(0, 1);
cell.setValue(9.53);
cell = cells.getCell(1, 0);
cell.setValue(“value B”);
cell = cells.getCell(1, 1);
cell.setValue(5.17);
cell = cells.getCell(2, 0);
cell.setValue(“value C”);
cell = cells.getCell(2, 1);
cell.setValue(1.27);
Chart chart = sheet.getCharts().addChart(ChartType.BAR_CLUSTERED, 0, 2, 10, 10);
chart.getNSeries().add(“B1:B3”, true);
chart.getNSeries().setCategoryData(“A1:A3”);
chart.getCategoryAxis().getTitle().setText(“My y Axis title”);
chart.getValueAxis().getTitle().setText(“My X Axis Title”);
chart.getValueAxis().getTitle().getFont().setBold(true);
chart.getValueAxis().getTitle().setRotation(90);
book.save(“MyoutputODS” + “.ods”, FileFormatType.ODS);
book.save(“MyoutputXLS” + “.xls”, FileFormatType.EXCEL97TO2003);
Thank you.