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

Free Support Forum - aspose.com

ASeries title orientation in the chart

How can we set the direction of ASeries name in column chart using Aspose.Cells for java? right now, Aseries name is shown on right hand side of the chart but I want it to be just below the X Axis. How can we achieve this?

Hi,

Please create two workbooks manually using Ms-Excel.

One should be the input workbook and the other should be output workbook. We will investigate how to create an output workbook from input workbook programmatically using Aspose.Cells for Java and provide you a code example.

The reply which you have sent is not related to my question. Please check. Thanks.

Hi,


What my colleague referred to is that we are not sure of your requirement completely. You may elaborate further by providing us an example Excel file showing your need. We will look into it to provide you a programmatic solution using Aspose.Cells JAVA API.

Moreover, please go through our Technical Article on Setting appearance of Chart.

Thanks for your understanding and cooperation.

Please find my requirement in the screen shot attached.

Hi,


What I understand is that you need to change the position of Legend.

Please go through the Legend Class from API documentation. Also below is some source code that changes the position of the Legend to set it at the bottom of Chart Area. Attached are my input and output files.
Feel free to write back. Thank you

JAVA
Workbook book = new Workbook();
book.open(“C:\temp\bar.xls”);
Worksheet sheet = book.getWorksheets().getSheet(0);
Chart chart = sheet.getCharts().getChart(0);
Legend legend = chart.getLegend();
legend.setPosition(LegendPositionType.BOTTOM);
book.save(“C:\temp\out.xls”);

Thank you. Could you please tell one more thing?

In your excel sheet which contains chart, the background is blank or white. Looks like all the cells in the sheet are merged. How can we do that?

Hi,


I think you are referring to Grid Lines. There is a method in Worksheet Class that hide the Grid Lines.

JAVA
sheet.setGridlinesVisible(false);

Thank you very much. :slight_smile: