[Vaadin chart] data order is important

Hi,

I am very new to vaadin chart (4 hours experience). Just noticed a weird thing in vaadin chart. Say if I have a data series of (date, double). If I load the data not in the asending order of the date (X axis) (say, random order or desending order), vaadin chart went crazy, tool tip behaves strangely. The order of the data series should not be programmer’s responsibility IMO.

Br,
Xuan

Hi,

With dates it is indeed probably always sane to keep the order and I guess the underlaying Higchart library “go grazy” in some situations. But most often the data is also already ordered properly, so forcing the the order would most of the time just waste computing power. If your data is not in proper order I’d suggest to pass it to DataSeries via e.g. java.util.TreeMap in your own code.

cheers,
matti

Hi,

This is enough to confirm. I am converting a few jfreecharts to Vaadin chart and copy the code from the former one to later. Then I noticed the HashTable mess up the Vaadin chart, after digging for a long while, I noticed the ordering problem. so just change the HashTable to LinkedHashMap will solve the problem. Similarly, if I have a List<>, have to sort it before adding to DataSeries.

Br,
Xuan