Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
chart script beforeDrawDataPointLabel question
somnix
<p>Hello ,</p>
<p> </p>
<p>probably a newbie question :</p>
<p> </p>
<p>i m trying to set the alignment for a PieChart label .</p>
<p> </p>
<p>i m able to get it but don't find how to set it without error.</p>
<p> </p>
<p>i tryed :</p>
<p> </p>
<p>function beforeDrawDataPointLabel( dph, label, icsc )<br>
{<br>
importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);<br>
<br>
<br>
toto = label.getCaption().getFont().getAlignment().getHorizontalAlignment();<br>
label.getCaption().setValue(toto);</p>
<p>
// label.getCaption().getFont().getAlignment().setHorizontalAlignment(HorizontalAlignment.LEFT);<br>
<br>
}</p>
<p> </p>
<p> </p>
<p>all label of the pie chart display "center" but when i try to set it i get this error message</p>
<p> </p>
<div>The following items have errors:</div>
<div>
<div> </div>
<div>Chart Grapha-MarketByBrandLast:</div>
<div><span>+ </span>ReferenceError: "HorizontalAlignment" is not defined at line 51 of chart script:''</div>
<div> </div>
<div> </div>
<div>did i miss an import package or i m not doing right</div>
<div> </div>
<div> </div>
<div>any idea ???</div>
<div> </div>
<div>thanks in advance</div>
<div> </div>
<div> </div>
</div>
<p> </p>
Find more posts tagged with
Comments
Clement Wong
<p>Try:</p>
<pre class="_prettyXprint">
alignment = label.getCaption().getFont().getAlignment();
alignment.setHorizontalAlignment(org.eclipse.birt.chart.model.attribute.HorizontalAlignment.getByName("Left"));
</pre>
<p><a data-ipb='nomediaparse' href='
http://help.eclipse.org/mars/index.jsp?topic=/org.eclipse.birt.chart.doc.isv/chart/api/org/eclipse/birt/chart/model/attribute/HorizontalAlignment.html'>Reference
for HorizontalAlignment</a>.</p>
somnix
<p>Thanks a lot Clement</p>
<p> </p>
<p>with your help i was able to solved a question i had last april ... how to avoid overlapping on a pie Chart .</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/36514-how-to-set-the-position-of-a-label-to-avoid-overlapping/?p=140535'>http://developer.actuate.com/community/forum/index.php?/topic/36514-how-to-set-the-position-of-a-label-to-avoid-overlapping/?p=140535</a></p>
;