Jump to content
Changes to the Jaspersoft community edition download ×

pie chart problem


Recommended Posts

By: Vincent Ong - vincentinc

pie chart problem

2006-01-13 00:37

Hi all,

 

I'm new to jasper reports. I'm lost trying draw a pie chart.

 

The follow sql is used as dataset for the chart. The query will return 28 rows of name => count values.

 

select customers.first_name, count(*) from shipments inner join customers on shipments.customer_id = customers.id group by customers.first_name;

 

I'm expecting to see 1 simple pie chart with 28 sections. However, the report generated 28 charts, all of the appear to be the same.

 

Is there something wrong with my sql or something wrong with my design?

 

Thanks

Vincent

 

 

 

 

By: raffimd - raffimd

RE: pie chart problem

2006-02-06 02:10

Hi,

I want to plot a pie chart based on a column in a table. I have a column called "usage". It may contain one of the values "Used" and "Free". I want to plot a pie chart for the usage in the header portion of the report. I tried creating a variable for counting and created a group and a pie chart. But i am missing something in the dataset.

Can you pelase help me out.

 

Thanks in advance.

Raffi

 

-------------------

<variable name="UsageCount" class="java.lang.Integer" resetType="Group" resetGroup="UsageGroup" incrementGroup="UsageGroup" calculation="Count">

<variableExpression><![CDATA[$F{USAGE}]]></variableExpression>

</variable>

 

<group name="UsgaeGroup">

<groupExpression><![CDATA[$F{USAGE}]]></groupExpression>

</group>

 

<pieChart>

<chart isShowLegend="false">

<reportElement positionType="Float" x="586" y="90" width="84" height="52"/>

<chartTitle>

</chartTitle>

<chartSubtitle>

</chartSubtitle>

</chart>

<pieDataset>

<dataset resetType="None"/>

<keyExpression><![CDATA[$F{R_TYPE}]]></keyExpression>

<valueExpression><![CDATA[$V{RuleTypeCount}]]></valueExpression>

<labelExpression><![CDATA[$F{R_TYPE}]]></labelExpression>

</pieDataset>

<piePlot>

<plot/>

</piePlot>

</pieChart>

 

--------------------------------------------------

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...