Hi, i would like to update the title text direction from vertical to horizontal, but i didn’t find a way can do that: can you please help? here’s my sample code.
i tried:
chart.getValueAxis().getTitle().setRotationAngle()
chart.getValueAxis().getTitle().setTextDirection();
chart.getValueAxis().getTitle().setHorizontalAlignment();
chart.getValueAxis().getTitle().setVerticalAlignment();
Workbook workbook = new Workbook();
WorksheetCollection worksheets = workbook.getWorksheets();
// Obtaining the reference of the first worksheet
Worksheet worksheet = worksheets.get(0);
Cells cells = worksheet.getCells();
cells.get(“A1”).setValue(16393);
cells.get(“B1”).setValue(“Microsoft”);
// Adding a chart to the worksheet
ChartCollection charts = worksheet.getCharts();
// Accessing the instance of the newly added chart
int chartIndex = charts.add(ChartType.BAR, 5, 5, 40, 25);
Chart chart = charts.get(chartIndex);
SeriesCollection nSeries = chart.getNSeries();
nSeries.add(“A1:A1”, true);
nSeries.setCategoryData(“B1:B1”);
Title title = chart.getTitle();
title.setText(“Top Employers”);
// Setting the font color of the chart title to blue
Font font = title.getFont();
font.setColor(Color.getBlue());
Axis valueAxis = chart.getValueAxis();
title = valueAxis.getTitle();
title.setText(“number of followers”);
// title.setRotationAngle(90);
// title.setTextDirection();
// title.setTextHorizontalAlignment(0);
// title.setTextVerticalAlignment(1);
// nSeries.changeSeriesOrder(0, 9);
workbook.save(“sampleChart1.xls”);