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)
chart script beforeDrawDataPointLabel question
somnix
<p>Hello,</p>
<p> </p>
<p>i m trying to understand how is beforeDrawDataPointLabel() working .</p>
<p> </p>
<p>i made a simple report based on a flat file :</p>
<p> </p>
<p>
Find more posts tagged with
Comments
Clement Wong
<p>The output you are seeing is because for each series, your counter will be reset to 0 in <span><em>beforeDrawSeries</em>.</span></p>
<p> </p>
<p>You can move that first line to <em>beforeGeneration</em>:</p>
<pre class="_prettyXprint">
function beforeGeneration( chart, icsc )
{
icsc.getExternalContext().getScriptable().setPersistentGlobalVariable("count","0");
}</pre>
<p>Attached is a sample based Classic Models and with your code (slightly modified).</p>
<p> </p>
<p>
somnix
<p>thanks a lot .... i was confused with serie and bar</p>
somnix
<p>One more question :</p>
<p> </p>
<p>the sort is based on the "ranking" column of the dataset.</p>
<p> </p>
<p>On the result, i can see that the last bar is sorted like this and first (or previous bar if many) is sorted</p>
<p>with the corresponding serie.</p>
<p> </p>
<p>is there a way to sort another one than the last one or to sort each bar independently</p>
Clement Wong
<p>I'm not sure I quite understand your question.</p>
<p> </p>
<p>The sort order will be dependent on the "Optional Y Series Grouping" sort options. You can change this via the Sort option in the Edit Chart > Select Data > Optional Y Series Grouping. In my example, the default is sorting by the "STATUS" from Z-A.</p>
<p> </p>
<p>The sort order will be applicable to all the Categories (X) Series.</p>
somnix
<p>i ordered the series on the ranking column and here is the result :</p>
<p> </p>
<p>
Clement Wong
<p>With OS BIRT, there is no straight-forward method to do this.</p>
<p> </p>
<p>With commercial BIRT, we can use HTML5 (HighCharts) scripting to rearrange the stacking order based on size (<a data-ipb='nomediaparse' href='
http://jsfiddle.net/sllimrovert/5dnekz0t/'>JSFiddle
example</a>).</p>
somnix
<p>thanks a lot clement</p>