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)
Wrapping Label in Radar Chart
patilsharan
<p>Please let me know how to wrap the label for Radar Chart, i have tried to add script to the functions beforeDrawDataPointLabel and beforeDrawAxisLabel but it is not working.</p>
Find more posts tagged with
Comments
mwilliams
<p>What is the script you added and what is your BIRT version?</p>
patilsharan
<p>Version : 2.6</p>
<p> </p>
<p> </p>
<p>function beforeDrawDataPointLabel( dph, label, icsc )<br>
{<br>
var tst=label.getCaption().getValue();<br>
var arr = tst.split(' ');<br>
//label.getCaption().setValue(tst[0]+"\n"+ tst[1]);<br>
var newlable = "" ;<br>
for ( i = 0; i < arr.length ; arr++ )<br>
newlabel = newlabel + arr
+ "\n" ;<br>
<br>
label.getCaption().setValue(newlabel);<br>
}<br><br><br>
function beforeDrawAxisLabel( axis, label, icsc )<br>
{<br>
var tst=label.getCaption().getValue();<br>
var arr = tst.split(' ');<br>
//label.getCaption().setValue(tst[0]+"\n"+ tst[1]);<br>
var newlable = "" ;<br>
for ( i = 0; i < arr.length ; arr++ )<br>
newlabel = newlabel + arr
+ "\n" ;<br>
<br>
label.getCaption().setValue(newlabel);<br>
}<br>
</p>
<p> </p>
<p>Basically iam trying to split the label based on blank space, I have attached the sample report.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>You have a logic error in your for loop. It should read:</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">for ( i = 0; i < arr.length ; <span style="color:#ff0000;">i++</span> ) {</span><br>
</p>
<p>not</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">for ( i = 0; i < arr.length ; <span style="color:#ff0000;">arr++</span> ) {</span><br>
</p>
<p>Also, your variable declaration should read:</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">var newlab<span style="color:#ff0000;">el</span> = "";</span></p>
<p> </p>
<p>not</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">var newlab<span style="color:#ff0000;">le</span> = "";</span></p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
patilsharan
<p>The code was just an example i was trying to show here, i have changed from arr++ to i++ and correct the variable name to <span style="font-family:'courier new', courier, monospace;">newlab<span style="color:#ff0000;">el</span> but there is not change in report output. </span></p>
pricher
<p>I am puzzled. The attached report, built in BIRT 2.6.2, works fine for me.</p>
<p> </p>
<p>P.</p>
mwilliams
<p>The wrapping of the labels works for me as well.</p>