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

HTML5 Chart - Problem displaying data


justin.brown11
Go to solution Solved by prusyn,

Recommended Posts

Hello there,

I'm having a problem displaying a small table as a bar chart using the HTML5 Pro tool in Jaspersoft Studio Pro 6.2.0.

Here is what my SQL output looks like:

ipp48nf_0.png.c74c440309c79bb3b84fba3d211b23b9.png

In Jaspersoft I'm ending up with two charts, with both 2018 and 2018 figures added together (Essentially a duplicated chart). 

My chart configuration looks like this:

7ewwber.png.ee90370a506102805fb5a8734b3b1db3.png

I've already checked the following: 

The report is located in the details band, the evaluation time is set to "Report", The "Reset Type" is set to "Report" under the Dataset tab, and I can't set a "Increment Type" because there are no groups. 

The chart (after adding it to the summary band) looks like this:

8yfvlfj.png.839686bf26ce78f355f76fd71cec6053.png

I'm trying to group the months from 18/17 side by side.

Please help? :c

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution

As I understand the problem is you see two charts, while you should be seeing only one. In this case the problem is that you put the chart in detail band. Everything present in detail band is printed as many times as there are rows in dataset. If you had 100 rows in dataset, you'd end up with 1000 charts :)

Another issue you might experience would be Caused by: net.sf.jasperreports.engine.JRRuntimeException: Error incrementing bidimensional dataset.

What I would suggest - place Chart into Summary band.

Link to comment
Share on other sites

I've managed to work this out myself (Thanks for the tip about the summary).

My workaround for this appears to work for only bar charts (but nonetheless). What I've done is alter my SQL output slightly to output everything to one line, in my dataset I've only dealing with two specified years ($P{YEAR} and $P{YEAR}-1).

The ordering of the bars as mentioned below appears to order the fields from left to right meaning I can use field names such as Jan-18 and Jan-17 in order to correct the ordering. 

However, because the years are user-specified I've simply used the label expression: "Jan-" + $F{CURR} and "Jan-" + $F{PREV}.

The drawbacks are:

  • I've had to add each month twice
  • This only appears to work for bar-chart type charts. 

 

 

 

 

 

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