Hello,
I am using Aspose.Words for Java version 25.5 to generate charts. I would like to rotate the title of the secondary, so that the axis title appears vertically.
I can rotate the axis tick labels via AxisTickLabels.setRotation(), but I cannot find any API that allows the axis title itself (ChartAxis.getTitle()) to be rotated. There seems to be no setRotation() or setOrientation() property available for axis titles.
My question is:
Does Aspose.Words currently support rotating axis titles, especially the secondary axis title?
If not, is there any recommended workaround, or is support for this feature planned?
Summary
As of the information publicly available for Aspose.Words for Java (including version 25.5), the library does not expose a property or method to rotate a chart axis title directly. The ChartAxis.getTitle() object provides only basic text‑setting capabilities and lacks any rotation‑related members.
Why it happens
The axis title is treated as a simple text element within the chart model. While tick‑label text has a setRotation() method, the title object does not include a comparable API, so native rotation is not currently supported through the Word‑processing API.
What to do next
Verify the current API – Inspect the ChartAxisTitle class in the version you are using; you will see that it offers methods for setting the text, font, and formatting, but no rotation or orientation options.
Work‑around – Create a separate rotated text box (or shape) and position it next to the axis to mimic a rotated title:
Shape txtBox = new Shape(doc, ShapeType.TEXT_BOX);
txtBox.setWidth(50);
txtBox.setHeight(200);
txtBox.getTextFrame().setText("Your Axis Title");
txtBox.getTextFrame().getParagraphs().get(0).getParagraphFormat()
.setAlignment(ParagraphAlignment.CENTER);
txtBox.setRotationAngle(-90); // rotates 90° counter‑clockwise
// Adjust the location to align with the secondary axis
chart.getParentNode().insertAfter(txtBox, chart);
This approach gives the visual effect of a rotated axis title.
3. Check newer releases – Review the release notes or API reference for any later version of Aspose.Words for Java; if a rotation property has been added, upgrading will provide native support.
4. Submit a feature request – If native rotation is essential, you can raise a feature request with Aspose (e.g., via their support portal or community forums) and provide a minimal reproducible example.
5. Alternative – Generate the chart with a tool that supports axis‑title rotation (such as Aspose.Slides or Aspose.Cells), export it as an image, and insert the image into the Word document.
Note: The above guidance is based on the current public documentation and typical usage patterns. For the most accurate and up‑to‑date information, consult the official Aspose.Words for Java API reference or contact Aspose support.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@B4chi
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): WORDSNET-28864
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.