njrfrens Posted March 11, 2009 Share Posted March 11, 2009 Can any one inform me how to implement grouping while implementing StackedBar Chart using Jasper Reports...Attached is the Sample Chart to be developed.It can be done in JFreeChart by using GroupedStackedBarRenderer.But I want to know how to do the same in Jasper Reports... Link to comment Share on other sites More sharing options...
njrfrens Posted April 3, 2009 Author Share Posted April 3, 2009 Hi Can any one please inform me if there is any solution for it...? At least can please inform me whether this is feasible or not? Link to comment Share on other sites More sharing options...
lucianc Posted April 6, 2009 Share Posted April 6, 2009 There is no support for this in JasperReports.If the dataset of such a chart is the same as the dataset of a regular stacked bar chart, one could implement such a chart in JR using a chart customizer or chart theme.Regards,Lucian Link to comment Share on other sites More sharing options...
njrfrens Posted April 8, 2009 Author Share Posted April 8, 2009 Can please provide more information how to achieve the same by chart customizer? any pointers where I can refer for the same...? Link to comment Share on other sites More sharing options...
njrfrens Posted April 8, 2009 Author Share Posted April 8, 2009 Got it... Its quite simple... Just wrote below code in customize method of the Chart Customizer class and it worked :-)Code:GroupedStackedBarRenderer renderer = new GroupedStackedBarRenderer();KeyToGroupMap map = new KeyToGroupMap("G1");map.mapKeyToGroup("Facility 1(ONE)", "G1");map.mapKeyToGroup("Facility 2(ONE)", "G1");map.mapKeyToGroup("Facility 3(ONE)", "G1");map.mapKeyToGroup("Facility 4(ONE)", "G1");map.mapKeyToGroup("Facility 1(ALL)", "G2");map.mapKeyToGroup("Facility 2(ALL)", "G2");map.mapKeyToGroup("Facility 3(ALL)", "G2");map.mapKeyToGroup("Facility 4(ALL)", "G2");renderer.setSeriesToGroupMap(map); CategoryPlot plot = (CategoryPlot) chart.getPlot();plot.setRenderer(renderer);Post Edited by janardan n at 04/08/09 08:31 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