Tips & Tricks: Grouping and Sorting of Data with VARCHART JGantt

Posted by Martin Karlowitsch on Jul 12, 2012 12:09:00 PM

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.

Group sorted 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.

Topics: Java Gantt Control, JGantt development tricks, Gantt Chart Controls