recompute chart label canvas [message #1063489] |
Thu, 13 June 2013 09:52 |
hage Mising name Messages: 67 Registered: September 2011 |
Member |
|
|
Hi,
due to a to big amount of chars in my axis labels i recompute the labelstrings like this:
function beforeDrawAxisLabel( axis, label, icsc )
{
value = label.getCaption().getValue();
sb = new StringBuilder();
if(value.contains(" ")){
number = value.substring(0, value.indexOf(" "));
try{
Integer.parseInt(number);
sb.append(number);
} catch (e){
if(value.length() > 8){
sb.append(value.substring(0, 8));
sb.append("...");
} else {
sb.append(value);
}
}
} else {
if(sb.length() == 0){
if(value.length() > 8){
sb.append(value.substring(0, 8));
sb.append("...");
} else {
sb.append(value);
}
}
}
label.getCaption().setValue(sb.toString().trim());
label.getCaption().getFont().setRotation(0);
axis.setLabel(label);
}
That reduces my input strings from "23 foooooooooooooooooooooooo" to "23", or "fooooooooooooooooooooo" to "fooooooo...".Nevertheless, the space reserved for the label is still that big, as the string (caption) still has its original length. That induces there are only a few labels visible, since their reserved space is pushing the others to a non-visible area. How can i tell the engine, to recompute the space reserved for that image.
I already set the rotation of the labels to 90, to preserve my chart from gettin' to far away from the left side of the page.
thx in advance,
hage
|
|
|
|
Powered by
FUDForum. Page generated in 0.03177 seconds