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)
How to draw half or 3/4th of the pie chart?
BIRT User
<p>Hi,</p>
<p>Currently Pie charts in BIRT are drawn by accounting the data to 100 %.</p>
<p>I have some requiremnt where i have to display empty space(white color) in the pie chart if the total values are less than 100.</p>
<p>For eg.I am considering 100 as the maximum total value and if the total sum is 70, my pie chart should display white space for remaining 30.</p>
<p> </p>
<p>Is there a way to implement this in BIRT?.</p>
<p> </p>
<p>Please help me out.</p>
Find more posts tagged with
Comments
pricher
<p>Hi Ragu,</p>
<p> </p>
<p>If it's possible, try to work on the data to manage your situation.</p>
<p> </p>
<p>I am sending you an example that contains two charts, one where the grand total is less than 100, another one where it is greater than 100. The two charts are built the same way, except that one is bound to a data set where the grand total is less than 100, and the other is bound to a data set where the grand total is greater than 100. As you can see in the data set, the empty category is calculated by subtracting the grand total from 100. If that result is negative, it will be filtered out in the chart (look at the filters on row[CNT] in the chart binding).</p>
<p> </p>
<p>I have also added some scripting at the chart level to take care of the empty series color and hiding the empty data point label and legend entry.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
BIRT User
<p>Hi Pricher,</p>
<p>Thank you so much for your reply. Your fix is working fine for SVG chart format. I have tried to implement the same logic for HTML chart format but its not working.</p>
<p> </p>
<p>Any idea why?. or is there any other way to implment the same for HTML format.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>I should have asked you which version of BIRT you were using...</p>
<p> </p>
<p>If you are using HTML5 charts, then the scripting goes somewhere else and uses the Highcharts API. Right now, I am struggling to find a way to remove the leader line and label for the invisible slice. In any case, I am sending you what I have come up with so far.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
BIRT User
<p>Hi Pricher,</p>
<p> </p>
<p>I am using Actuate BIRT iHub3 and we are using HTML5 charts which uses HighCharts API. The scripting will be done in client scripts part which runs in browser.</p>
<p>Please reply me when you find a way to hide the label. I am struggling with that.</p>
<p> </p>
<p>Thanks for your reply.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>I have googled the Highcharts API multiple ways and was not able to find a way to hide or change the appearance of just one label in a pie chart.</p>
<p> </p>
<p>As a workaround, you could hide the display of value labels on the pie chart and instead show the value of each category in the legend. I am sending you an updated report that adds the value of each category in the legend through script.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
BIRT User
<p>Thanks Pricher for the workaround.</p>