HTML5 Chart - Problem displaying data

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.

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:


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:


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:

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

Please help? :c


justin.brown11's picture
Joined: Apr 5 2017 - 6:16am
Last seen: 1 year 9 months ago

Hi prusyn,

I've added the chart into the summary band and you are indeed correct, Now I'm only seeing one chart. The issue now is that both the 2018 and the 2017 results are added together as if the chart isn't grouping on the year. What am i doing wrong? :( 

Here is what the "Year" category looks like:

justin.brown11 - 3 years 6 months ago

If i understood you correctly, this is something you want to acheive:

If so, I have attached sample report to my original answer. I hope this helps.

prusyn - 3 years 7 months ago

2 Answers:

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.

Binary Data mainreport.jrxml4.33 KB
prusyn's picture
Joined: Feb 22 2018 - 3:49am
Last seen: 1 year 8 months ago

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. 






justin.brown11's picture
Joined: Apr 5 2017 - 6:16am
Last seen: 1 year 9 months ago