|
Left-Justifying Custom Axis Labels |
Posted by Walt on Jul-14-2011 05:57 |
|
Hi, Walt again.
For many years we have been trying to solve this problem. It's pretty self-explanatory given
this thread's subject and the attached screenshot.
Does anyone have ideas on how to achieve left-justification here? Short of calculating the
width of each character's font glyph from pts to px and then appending white'space' to the
end of each label in order to manually align the left side of each label, this seems impossible
via the API.
Does anyone know otherwise?
I am using the Java version of CD.
|
Re: Left-Justifying Custom Axis Labels |
Posted by Peter Kwan on Jul-14-2011 18:31 |
|
Hi Walt,
To left justify things, you would need to determine where to left justisfy against. (For example, in a MS Word document, you may left justisfy against the left margin of the page, etc.)
For your case, you may try something like:
ChartDirector.TextBox t = c.yAxis().setLabelStyle("Arial", 10);
// set the text box size, so there is something to left justisfy against
t.setSize(c.getPlotArea().getLeftX() - 6, 0);
t.setAlignment(Chart.Left);
Hope this can help.
Regards
Peter Kwan |
Re: Left-Justifying Custom Axis Labels |
Posted by Walt on Jul-15-2011 22:51 |
|
Thank you, this workflow did produce the kind of results I was looking for. |
|