recompute chart label canvas [message #1063489] |
Thu, 13 June 2013 05:52  |
Eclipse User |
|
|
|
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
|
|
|
Re: recompute chart label canvas [message #1064132 is a reply to message #1063489] |
Mon, 17 June 2013 14:30  |
Eclipse User |
|
|
|
You can change the insets in the chart UI so the space is reduced. Or if you want the chart engine to fit it for you then you could create an invisible table with the data being used in the chart and change the label data there, then use the table as the data source for your chart. I haven't tested it yet but I think that should do the trick so you don't have to change any of the insets yourself.
|
|
|
Powered by
FUDForum. Page generated in 0.05967 seconds