leniviy Posted August 3, 2010 Share Posted August 3, 2010 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 1000This should give 5 separate charts having 1 barhttp://jasperforge.org/uploads/forum/101/77386/chart.pngPost Edited by leniviy at 08/03/2010 06:25Post Edited by leniviy at 08/03/2010 11:10 Link to comment Share on other sites More sharing options...
leniviy Posted August 3, 2010 Author Share Posted August 3, 2010 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 pageTo 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now