[#2761] - Can't Retain Query/Datasource Level Sorting With HTML5 Charts

Category:
Enhancement request
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Feature
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

I have a solution but it needs to be baked in.
I was frustrated by the default sorting order on the HTML5 charts. To customize the sort order you must create a comparator. And even then you can only sort by a category or series, not by a measure! I wanted to be able to sort my data in the query to solve these problems. The GUI provided no solutions besides the limited ascending or descending selections.

The Solution:
Create a comparator which always returns a value of 1 (greater than). iReport sees that the data is already in order and doesn't change anything. This allows you to define ordering at the query level! See the attached java file for more info. I've also attached a jar if you just want the fix.

To use:
Add jar to classpath.
Instantiate the custom comparator in the Comparator Expr box for the desired series or category. Enjoy query level sorting!

AttachmentSize
File My Source551 bytes
File My jar3.04 KB
v5.0
HTML5 Charts
StevenCrawford's picture
Joined: Feb 19 2013 - 8:09am
Last seen: 3 years 5 days ago
Feedback