rainer.stuelp Posted March 10, 2020 Share Posted March 10, 2020 Hi,I am using JAVA with beans to create a jasper report with a chart that has two series.The data I put to tje JasperFillManager has the following structure:public class Dot { Double x; Double y;// Getter and Setter here ...}public class Payload { ArrayList<Dot> defaultPoints; ArrayList<Dot> sprintPoints; // Getter and Setter here ...}...Map<String,Object> parameters = new HashMap<String,Object>();Payload payload = new Payload();// fill payload with values for defaultPoints and sprintPoints...parameters.put("payload", payload);...JasperPrint jasperPrint = JasperFillManager.fillReport(reportPath, parameters);[/code]I have a main report (including a parameter "payload") which contains a subreport. In the subreport I want to draw the chart. The subreport has the paraneter "payload", too and the main report is passing the value to the subreport.The subreport has two fields:x: java.lang.Doubley: java.lang.DoubleI inserted a char element (XY Line) and set Y value to $F{y} and X value to $F{x}.I have added two series. How can I assign defaultPoints to Series 1 and sprintPoints to Series 2?Regards,Rainer Link to comment Share on other sites More sharing options...
rainer.stuelp Posted March 23, 2020 Author Share Posted March 23, 2020 I found a solution how it works.public class Dot { Long x; Double y; String graphName;// Getter and Setter here}public class Chart { ArrayList<Dot> punkte;// Getter and Setter here}[/code]Each dot needs to know to which series it belongs.So, the series value must be $F{graphName}JasperReports detects a new series name and starts with a new series 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