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)
Doughnut charts
RRK
<p>HI,</p>
<p> </p>
<p>Do we have an option in Actuate birt to create doughnut charts as in excel.</p>
<p>Please find attached.</p>
<p> </p>
<p>Thanks in advance!!!!</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>To create a doughnut chart, use the Pie Chart type and control the Inner Radius in Format Chart --> Value Series, as shown in this screenshot.</p>
<p> </p>
<p>
RRK
<p>Hi Pierre,</p>
<p> </p>
<p>Thanks this helps.</p>
<p> </p>
<p>One more question on this can we show a label in middle of doughnut as in attached file.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>This will require a bit of scripting.</p>
<p> </p>
<p>First, some Highcharts API scripting that you can apply to the chart to make the title centered both horizontally and vertically:</p>
<pre class="_prettyXprint _lang-">
beforeGeneration: function(options)
{
//You can change options here.
options.title =
{
verticalAlign: 'middle',
align: 'center'
}
},
</pre>
<p>Then, assuming that the label you put in the middle of the doughnut will have a dynamic value, you need to assign that value to the chart title at render time. Here, I have added the following script to the beforeRender event of the report:</p>
<pre class="_prettyXprint _lang-">
var rr = reportContext.getReportRunnable();
var chart1 = rr.designHandle.getDesignHandle().findElement("Chart1");
chart1.getReportItem().getProperty("chart.instance").getTitle().getLabel().getCaption().setValue(reportContext.getPersistentGlobalVariable("TotalCountries"));
</pre>
<p>In the above code, the value of Persistent Global Variable "TotalCountries" is set in the onCreate event of table footer above the chart. Your scenario might be different, so where you set that variable may differ:</p>
<pre class="_prettyXprint _lang-">
reportContext.setPersistentGlobalVariable("TotalCountries", row["TotalCountries"].toString());
</pre>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
RRK
<p>Thanks Pierre ..</p>
<p> </p>
<p>The solution helps
</p>
<p> </p>
<p>In my case it will come from database as column so the approach is useful ..</p>
Lynne Huang
<p>Hi,</p>
<p> </p>
<p>Can I ask if someone meet the same issue that even I set the inner radius you mentioned above, and also I could see it's donut chart in the view mode (the edit mode), but when I tried to generate the report, it's still pie chart instead of donut chart?</p>
<p> </p>
<p>Thank you.</p>
Clement Wong
<p>What version of commercial BIRT are you using?</p>
<p> </p>
<p>Did you add any chart scripting, or are you using a library?</p>
<p> </p>
<p>Please try the attached sample design to test in your environment. It was tested in both iHub 3.1, and 16.</p>