Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Lack of Timeline.DateRangeListener in Charts 3
In Charts 2 there was Timeline component with DateRangeListener which was called each time when user modifies the selected date range by moving the date range selector.
Unfortunatelly, in Charts 3 I can not find such possibility to listen to date range selection. Now the timeline is embeded into charts. But charts don't have similar liteners.
Is there some workaround for that?
Hi Igor,
That feature is now covered with the XAxesExtremesChangeListener. Event min and max are Number so com.vaadin.addon.charts.util.Util.toServerDate is needed if you want to work with Date objects.
chart.addXAxesExtremesChangeListener(new XAxesExtremesChangeListener() {
@Override
public void onXAxesExtremesChange(XAxesExtremesChangeEvent event) {
Date min = Util.toServerDate(event.getMinimum().doubleValue());
Date max = Util.toServerDate(event.getMaximum().doubleValue());
//use min and max
//...
}
});
Hope this helps,
Guille