Need help in changing the Position of the Axis label Titles with Aspose cells java api.
X-axis one to the end and Y-axis one to the top with alignment same as axis labels.
Attaching the sample excel for reference.ChartAxisTitle-01.zip (9.6 KB)
@SrideviG
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-52912
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
I have done the test, the CategoryAxis Title is supported now, and ValueAxis Title will be supported later. Please try the solution and tell us your feed back.
Hi @SrideviG
Please use Aspose.Cells for java 23.3:
and try the following code:
Workbook book = new Workbook("TestFiles/ChartAxisTitle-01.xlsx");
Chart chart0 = book.getWorksheets().get(0).getCharts().get(0);
chart0.calculate();
for (int ii = 0; ii < 8; ii++)
{
chart0.getCategoryAxis().getTitle().setX((int)(chart0.getCategoryAxis().getTickLabels().getTickLabelItems()[ii].getX() * 4000));
chart0.getCategoryAxis().getTitle().setY((int)(chart0.getCategoryAxis().getTickLabels().getTickLabelItems()[ii].getY() * 4000));
chart0.getValueAxis().getTitle().setX((int)(chart0.getValueAxis().getTickLabels().getTickLabelItems()[ii].getX() * 4000));
chart0.getValueAxis().getTitle().setY((int)(chart0.getValueAxis().getTickLabels().getTickLabelItems()[ii].getY() * 4000));
chart0.toImage("ResultFiles/CELLSNET52912_" + ii + ".png");
}
The above code is to show how to get ticklabel position, to adjust the position of the Axis label to achieve alignment. You can modify it to suit your needs.