How can I create a donut chart in Jasper soft studio?

0

I am using TIBCO Jaspersoft® Studio 6.17.0. I am in need of creating a Donut chart. I can create pie chart, but could not find a way to create donut chart like I can do in Jasper Reports Library. Any help is appreciated. 

tabudev's picture
Joined: Aug 2 2021 - 7:44am
Last seen: 3 months 2 weeks ago

3 Answers:

2

If you are using the Commercial Edition Studio, you can select 'Doughnut' in 'Charts Pro'.

 

For your reference.

 

yama818's picture
382
Joined: Aug 17 2018 - 3:48pm
Last seen: 1 hour 5 min ago
1

If you're stuck with the Community edition, you can always do a dirty and draw a circle over a pie chart.....

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.17.0.final using JasperReports Library version 6.1.1  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="donut" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="727dab2e-454f-40b0-8cef-f5e84909713b">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
    <queryString language="SQL">
        <![CDATA[SELECT "ADDRESS"."CITY", COUNT("ADDRESS"."CITY") FROM ADDRESS GROUP BY CITY]]>
    </queryString>
    <field name="CITY" class="java.lang.String"/>
    <field name="C2" class="java.lang.Long"/>
    <title>
        <band height="570" splitType="Stretch">
            <pieChart>
                <chart evaluationTime="Report">
                    <reportElement x="0" y="0" width="500" height="500" uuid="c66c6d48-9128-4d09-9e15-ae1e97130fde">
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    </reportElement>
                    <chartTitle/>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>
                <pieDataset>
                    <dataset resetType="Report"/>
                    <keyExpression><![CDATA[$F{CITY}]]></keyExpression>
                    <valueExpression><![CDATA[$F{C2}]]></valueExpression>
                </pieDataset>
                <piePlot>
                    <plot/>
                    <itemLabel/>
                </piePlot>
            </pieChart>
            <ellipse>
                <reportElement x="175" y="152" width="150" height="150" uuid="4878fbf0-0c68-4d81-8945-ca8900fc2b50"/>
            </ellipse>
        </band>
    </title>
</jasperReport>

zellers's picture
72
Joined: Feb 12 2019 - 11:18am
Last seen: 1 day 21 hours ago
0

Using the commercial edition, you can render a HighCharts pie chart and set the innerSize property: https://api.highcharts.com/highcharts/series.pie.innerSize

johannes.held's picture
Joined: Dec 2 2015 - 12:51am
Last seen: 1 week 5 days ago
Feedback
randomness