Is there a way to sort the items in a JFreeChart legend by their backing object?
I've noticed that the TimeSeries/Series sets the title via a Comparable object.
Is there a way or a setting that forces the legend to be sorted by the comparable objects that the items are representing? Currently the legend is sorted by FIFO order.
You could use the add() method of LegendItemCollection to add the items in the desired order. Most Plots have a setFixedLegendItems() method to override the default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With