Jump to content
We've recently updated our Privacy Statement, available here ×

Multiple lines on graph


trwalker

Recommended Posts

Hi Guys,

 

I have generated a simple line graph using a query, using the report query, and passing the necessary data to the graph, great, woohoo I hear you say. However, I need to actually have 4 sql queries, returning 4 sets of results, that I need to display on the graph as 4 traces. What is the easiest way for me to do this? I have tried to create a subdataset, but as far as I can see, this only lets me add one to the graph. Is there a way of creating 4 queries in iReports, and including them on the graph??

 

Thanks.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

i.e. I have created four subdatasets each having the same sort of query, but returning a different result. How do I access the returned fields from the subdatasets, and print them on the graph? Or am I barking up the wrong tree?

 

trwalker wrote:

Hi Guys,

I have generated a simple line graph using a query, using the report query, and passing the necessary data to the graph, great, woohoo I hear you say. However, I need to actually have 4 sql queries, returning 4 sets of results, that I need to display on the graph as 4 traces. What is the easiest way for me to do this? I have tried to create a subdataset, but as far as I can see, this only lets me add one to the graph. Is there a way of creating 4 queries in iReports, and including them on the graph??

Thanks.
Link to comment
Share on other sites

  • 1 month later...

Its very simple to display multiple lines. For this you don't have to write any subdata query or multiple queries. You can simply select for multiple values by declaring a Parameter for multiple values eg: value in ($P!{parameter})

 

Giving a syntax like this will enable you to give multiple values for a single query. Also note that in GROUP BY clause give a group by of "value".

 

Hope this will solve your problem.

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