justin.brown11 Posted November 22, 2018 Share Posted November 22, 2018 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: https://communities.ca.com/thread/241761121-jaspersoft-studio-561-html-chart-multi-value-parameterhttps://community.jaspersoft.com/questions/801726/how-use-html5-chartsAnd the iReports manualThe 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 Link to comment Share on other sites More sharing options...
Solution prusyn Posted November 22, 2018 Solution Share Posted November 22, 2018 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 More sharing options...
justin.brown11 Posted November 22, 2018 Author Share Posted November 22, 2018 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: Link to comment Share on other sites More sharing options...
prusyn Posted November 22, 2018 Share Posted November 22, 2018 If i understood you correctly, this is something you want to acheive: http://prntscr.com/lllkoxIf so, I have attached sample report to my original answer. I hope this helps. Link to comment Share on other sites More sharing options...
justin.brown11 Posted November 23, 2018 Author Share Posted November 23, 2018 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. https://community.jaspersoft.com/wiki/how-change-order-bars-html5-column-chartHowever, 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 twiceThis only appears to work for bar-chart type charts. 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