Jump to content

Time Series Chart Help


FoS

Recommended Posts

I've just started looking into using iReport for building management Reports (bright colours and that kind of thing to amuse them) but I'm beating my head against the wall with a simple report that I'm trying out to start getting a feel for iReport before I start creating bigger, more complex reports.

I'm using an SQL query to pull a Hostname, CPU Values and Timestamps and then populate a Time Series Chart so management can see what the CPU did over a given period.

What I get when I run the report is 1000+ Graphs, each with 1 value on.

I'd really appreciate some help.

*Edit* I neglected to mention I'm using 2.0.0.5 instead of 3.
Somehow I missed it when i downloaded iReport.

Attached is the jrxml. [file name=Test_Chart.jrxml size=3097]
Post edited by: FoS, at: 2008/06/10 13:28

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

What do you want to the chart to show? Looking at the report you have time, host and cpu usage, and you have two possible axis. Do you want a different line per host, showing CPU usage over time? A chart per host?

 

The current report you attached has the chart in the detail band. The detail band gets formatted once per row in the data, so in your case you get one chart per row, showing the data for that row.

 

If you want one chart per host, you need to create a group for the host, and put the chart in the group footer. To do this, you will need to

 

Create the group. Set the group expression to $F{host}

Order the data by host by adding "order by hst.host" to your query

Move the chart from the detail band to the group footer

Set the chart's evaluation time to "Group" and set the group field to the name of your host group

[/ol]

 

-Barry

Link to comment
Share on other sites

Thanks for the reply, it's got me looking in the right direction.

 

I'm trying to create a Chart that shows the CPU Usage over a given period (I've left out defining that period until I've got the majority of the report working)

 

A different Chart needs to be displayed per Host.

 

I've made the changes you've suggested but I'm getting a 700+ Report with 1 Graph on the last page that is incorrectly rendering.

Link to comment
Share on other sites

Sounds like you are making progress, believe it or not. I'm guessing the 700+ pages are blank, right? They are the contents of the detail band, rendered for each row. Even when you haven't dragged anything into the detail band it still has a height.

 

My guesses:

1) Set the detail band height to 0. You can either drag the bottom light line in iReport that marks the end of the detail band up until it disappears, or right click in the band, select "Band Properties" and set the height to 0 in the dialog that pops up.

 

2) It sounds like you only have one group for some reason. Double check your group expression is something that will change when you want it to. If you expression is something constant then every row will be in the same group. One good test is to put the expression in a field in the group header and footer, so you can see all the groups being processed.

 

Once you get rid of the empty detail band and get the groups right we can take a look at the chart.

 

-Barry

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