Jump to content
We've recently updated our Privacy Statement, available here ×

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


tabudev

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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>[/code]

 

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...