Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Changing Inset Points Depending upon other Values
cld49
Hey guys. I'm fairly new to BIRT, and really fumble when it comes to scripting. I've been having an issue where value labels overlap each other and become unreadable. (example image attached) I've found some other topics regarding this issue, but can't seem to find a solution. One post mentioned playing with the insets - but if you do that in the report designer than all of the labels get moved one direction or another together, and are still overlapping (right?).
Can you change the inset points on the fly with scripting? And if so, how would you do it? For example, if I wanted to say "if there are two counts and both of them are similar to one another, move the inset points of the first one upward, and the second one downward", would I be able to do that? Do I even have access to what the other columns counts are whenever whatever method I'd be changing the inset points in is running?
Lol, obviously I'd be really grateful for any help with this.
Thanks guys!
Find more posts tagged with
Comments
kclark
You should be able to alternate the inset from the series identifier in beforeDrawDataPointLabel()<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
temp = "";
inset = 0;
function beforeDrawDataPointLabel( dph, label, icsc )
{
if(temp != dph.getSeriesValue()){
if(inset != 20){
inset = 20;
label.getInsets().setBottom(inset);
}
else{
inset = 10;
label.getInsets().setBottom(inset);
}
temp = dph.getSeriesValue();
}
else{
label.getInsets().setBottom(inset);
}
}
</pre>
<br />
And you would need to figure out how close the points are to each other from afterDataSetFilled()
cld49
Awesome, I'll try this out right this very moment! Thank you!!!!
cld49
wowow it works! Thanks!!