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

Bar Chart with multiple series


sangi

Recommended Posts

Hi

 

I am trying to create a bar chart with multiple series.

 

I have one category: IP

Two Series: count_this_week and count_last_week

 

Category: IP

Series: this_week_count

 

This is my data:

IP this_week last_week

1 18865410 16777354

2 18728264 16750553

3 10700694 10651258

4 16853818 14657070

5 12255185 10836628

6 13810980 13504386

7 10815512 9091144

8 8921797 8655762

9 10576552 8847847

10 11326149 9543523

 

Here I am attaching the image which is generated in excel. Can I get the same kind of report using iReport. I tried creating two series with one category but didnt succeed. :(

 

Please help me.

 

 

 

size=350]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/barchart.PNG

 

Post edited by: sangi, at: 2008/06/04 15:45

Post edited by: sangi, at: 2008/06/04 15:46

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Try creating a categoryDataset with

 

Code:

<categorySeries>
<seriesExpression>"This Week"</seriesExpression>
<categoryExpression>$F{IP}</categoryExpression>
<valueExpression>$F{this_week}</valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression>"Last Week"</seriesExpression>
<categoryExpression>$F{IP}</categoryExpression>
<valueExpression>$F{last_week}</valueExpression>
</categorySeries>

 

The seriesExpression indicates the name of the series for a data point. The categoryExpression produces the x axis value, and the valueExpression produces the y axis value.

 

-Barry

Link to comment
Share on other sites

  • 5 years 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...