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:
- Create groups using jsonql in the Dataset and Query dialog.
- 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!
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.