ee.ashley Posted May 24, 2013 Share Posted May 24, 2013 I'm new to JasperReports and am using iReport Designer 4.5.0 to play around with how to generate charts.In this case, I am trying to generate a line chart, which in the simple case, might show three lines,Lline1, Line2 and Line3, where line1 and 2 are independant data, and Line3 is perhaps some combination of the two [e.g. an average such as (Line1+Line2)/2)].I've been trying to familiarize myself with what kind of datasets are required for the charts, and as far as I've found so far, it appears that to accomplish the scenario described above, my database query would at a minimum be required to return three columns of data: Category Line1 Value Line2 Value(Then I can calculate Line3 in a variable, or on the fly in the chart value field).However, due to the nature of my data, this requires me to do multiple joins on the table in order to get Line1 and Line2 data to be two adjacent columns. I'm concerned that this may get out of hand if I need to work with more and more Lines. In fact, in my original data has columns more like this: Category LineNumber ValueHowever, I couldn't seem to get the reporting tool to show two different trend lines based on a dataset like this?Is there a way to do chart based on this type of data? Link to comment Share on other sites More sharing options...
Solution Thomas Zimmer Posted May 26, 2013 Solution Share Posted May 26, 2013 No, just use a series expression: LineNumber (series expression) Category Valuewhere the line number can also be a nice name, which is shown in the legend.With the disadvantage, that you will have to extra-query the average line. Or you do this within a chart customizer.Cheers, Thomashttp://www.thomaszimmer.net 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