ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Need to increase the height of the X axis text area for long text
Posted by David Thielen on Feb-17-2019 03:41
Attachments:
I have the text for the xAxis values set to render sideways. However, the text is truncated because there is not enough room to display all of it.

How do I set it to make enough room?

And also, how do I force the sideways orientation? At present ChartDirector seems to be deciding and sometimes it's not what I want.

thanks - dave
actual_lauout.png
desired_layout.png

  Re: Need to increase the height of the X axis text area for long text
Posted by David Thielen on Feb-17-2019 03:42
Top image is what I get.

Bottom is what I want (from MS Word).

  Re: Need to increase the height of the X axis text area for long text
Posted by Peter Kwan on Feb-18-2019 17:33
Hi David,

To rotate the axis labels by 90 degrees, please use Axis.setLabelStyle. For example:

c.xAxis().setLabelStyle("Arial", 8, 0x000000, 90);

You can use XYChart.packPlotArea to adjust the plot area size so that all the labels are within the specified bounding box. For example:

c.packPlotArea(10, c.getPlotArea().getTopY(), c.getPlotArea().getRightX(), c.getHeight() - 10);

The packPlotArea needs to be called after you have entered all the data and configures everything (the font size, label format, etc) of the chart. For an example, see:

https://www.advsofteng.com/doc/cdnet.htm#markbar.htm

Hope this can help.

Regards
Peter Kwan