json(ql) datasets and charts

I haven't seen any explanations on how to format json data into groups to power charts in Jasper and I am struggling to work out how to do it.

I have json data with one field, "gender" and it is a string with two values M or F. I need to be able to group the data and then produce a pie chart to show the proportions of M and F.

The two options I thought might be solutions would be:

  1. Create groups using jsonql in the Dataset and Query dialog.
  2. Create a group in the main report and create a "count" field in the footer to tally it up and then use this in the chart

However I cannot find any way to do the above or if I am even on the right track. Does anyone know how to this? Thanks!

fizz112's picture
Joined: Jul 23 2018 - 2:38pm
Last seen: 3 years 8 months ago

1 Answer:

You can create groups in the report based on the report element (field, paramater) or expression. You don't need to use the query language for that. You can also create a sort field to sort the data before grouping. To do a totals count, you can create a variable with count calculation and reset type set on group you've created. In JSS to create a group right click on the root report object in the outline and press Create Group.

Friendly User's picture
Joined: Oct 8 2009 - 5:59am
Last seen: 3 weeks 1 day ago