Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Aligning axes labels
kevinshih
I am using the following code to "word-wrap" the labels on my x-axis.
function beforeDrawAxisLabel( axis, label, icsc ) {
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
if (axis.getType() != AxisType.LINEAR_LITERAL){ //Y-axis
var tst=label.getCaption().getValue();
label.getCaption().setValue(tst.substring(0,8) + "\r\n" + tst.substring(9));
label.setVisible(true);
}
}
It does the desired effect of word-wrapping the labels, but the text is left-aligned, i.e. the second line starts at the left-most point of the label. I'd prefer it to be center-aligned.
Anybody have any ideas?
Thanks!
Kevin
Find more posts tagged with
Comments
mwilliams
Hi Kevin,
Will it allow you to pad the second line with the appropriate amount of spaces?
kevinshih
Low tech but it works! So I guess some formatting options don't exist for the labels?
mwilliams
For something like that, I don't think there is. You could always request an enhancement for it.
http://www.birt-exchange.org/org/resources/bug-reporting/