Jump to content

Stacked Bar Chart help needed


xsjasper1005

Recommended Posts

Hi community,

I am new to jasper reporting and i have to develop a simple stacked bar chart report.

it should look like the stacked bar chart in the attachment - the sample stacked bar chart report is too complex so i don't understand how this thing works.

How should i group the data from the sql server to generate the diagram (i grouped it by the date - but what to do now)? The result should be 1 diagram in the report which shows the count and vendors for the whole month.

regards,

Franz.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

maybe somebody has the same problem, so i will post my solution:

First create a group for the dates (group expression is $F{DATE}) - name "DATE"

Now create a group for the vendors (group expression is $F{VENDOR}) within first group - name "VENDOR"

Now create the stacked bar chart with Increment Type "Group" and use VENDOR as the increment group.

For series expression use $F{VENDOR}

For category expression use $F{DATE}

For value expression use $F{COUNT}

Place the stacked bar chart in the Summary band.

That's it.

 

But currently my problem is the error message i got if the sql query returns no rows.

I get "Error filling print... Null 'dataset' argument."

Has anybody a solution for this?

EDIT: my workaround is to set the "printWhenExpression" to $V{DATE_COUNT} (the variable will be created by iReport automatically when you create the DATE group).

I think that will work correctly but i search for a solution to display an empty diagram.

 

regards,

Franz

 



Post Edited by xsjasper1005 at 05/31/2010 12:50



Post Edited by xsjasper1005 at 05/31/2010 12:51
Link to comment
Share on other sites

  • 6 months 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...