Jump to content

[SOLVED] multipage horizontal bar chart


leniviy

Recommended Posts

I need a horizontal bar chart having fixed width bars and multiple pages. Looks like I need to place the chart onto the detail band so its duplicated for each row, but how do I make it render only 1 bar for the current row?

CATEGORY ACTIVE_NUMBER TOTAL_COUNT-------- ------------- -----------a                  100        1000b                  200        1000c                  300        1000d                  400        1000e                  500        1000

This should give 5 separate charts having 1 bar

http://jasperforge.org/uploads/forum/101/77386/chart.png



Post Edited by leniviy at 08/03/2010 06:25



Post Edited by leniviy at 08/03/2010 11:10
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I found 2 ways to do this.

If I want the chart to have only 1 bar for the current row, I create a group "rownumgroup" with expression: $V{REPORT_COUNT} . Then in chart data set "Reset Type" to "Group" and "Reset group" to "rownumgroup".

To make the value axis not visible I have to use the customizer.

 

 

 

Another way is to restrict number of lines per page

To have 3 results per page add group rowsperpage with expression:

new Integer( (int) ( ($V{REPORT_COUNT}.intValue()-1) / 3 ) )

and mark it to start new group on a new page.

In this case the chart has to be placed in the page header band, not details band.

A customizer is still needed to call the renderer setMaximumBarWidth(), or the last page will contain very thick bars.

 

 

Link to comment
Share on other sites

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