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)
2-line Labels on a Pie Chart
jgisler
BIRT 2.6.2
I would like to format the label in my pie chart such that the label is displayed as
Category Data
Percentile Value Data
I tried adding a <br/> and \n to the Separator field in the Series Labels dialog but they do not render as newline.
How can I do this?
Find more posts tagged with
Comments
mwilliams
Try this instead. Put a colon( : ) as the separator field, then put this script in your onRender script of your chart:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawDataPointLabel( dph, label, icsc )
{
var tst=label.getCaption().getValue();
tst = tst.split(":");
label.getCaption().setValue(tst[0]+"\n"+ tst[1]);
}
</pre>
<br />
That should do it. Hope this helps.
jgisler
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="83579" data-time="1317321970" data-date="29 September 2011 - 11:46 AM"><p>
Try this instead. Put a colon( : ) as the separator field, then put this script in your onRender script of your chart:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawDataPointLabel( dph, label, icsc )
{
var tst=label.getCaption().getValue();
tst = tst.split(":");
label.getCaption().setValue(tst[0]+"\n"+ tst[1]);
}
</pre>
<br />
That should do it. Hope this helps.<br /></p></blockquote>
jgisler
That works, thanks!