Tips & Tricks: Grouping and Sorting of Data with VARCHART JGantt
|12. July 2012||Posted by Martin Karlowitsch under Tips, Tricks & FAQ, VARCHART JGantt|
A new tutorial for VARCHART JGantt (available on request), an advanced Gantt chart control for Java developers, shows how to structure data by grouping them and sorting them by certain criteria. This may be useful, for instance, if in an order view the orders with their individual tasks have to be sorted by order number or by due date.
Two entity sets are needed for this: One entity set containing the group information (GroupNodeSetName) and another one containing the node information (NodeSetName). With the method
myJGantt.setGroupsSortedBy (new NeGroupComparator(<attribute of the group entity set>, false));
the group can be sorted by any attribute of the group entity set. If the second parameter of the comparator is set to “true”, the group order will be reversed.
The nodes of a group can also be sorted by using
myJGantt.setNodesSortedBy (new NeEntityComparator (<attribute of the node entity set>, false));
Of course, the method can be used for other purposes as well: Projects could be displayed in a Gantt chart broken down by project number or status (planned/confirmed) for instance.
Here you can find more information, if you are a Java developer and want to embed a Java Gantt chart control into your scheduling application.