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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
Vaadin Charts 3: the graph is not displayed when timeline in navigator is l
The graph is not displayed when timeline in navigator is less than the maximum
Please see video
public class SingleLineSeries {
private final Collection<UsersMonthTo> avgCaloriesByMonths;
public SingleLineSeries(Collection<UsersMonthTo> avgCaloriesByMonths) {
this.avgCaloriesByMonths = avgCaloriesByMonths;
}
public String getDescription() { return "Single line chart with timeline"; }
protected Component getChart() {
final Chart chart = new Chart();
chart.setTimeline(true);
Configuration configuration = chart.getConfiguration();
configuration.getTitle().setText("AAPL Stock Price");
DataSeries dataSeries = new DataSeries();
for(UsersMonthTo avgCaloriesByMonth : avgCaloriesByMonths) {
DataSeriesItem item = new DataSeriesItem();
item.setX(Date.from(avgCaloriesByMonth.getDate().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
item.setY(avgCaloriesByMonth.getAvgCalories());
dataSeries.add(item);
}
configuration.setSeries(dataSeries);
RangeSelector rangeSelector = new RangeSelector();
rangeSelector.setSelected(1);
configuration.setRangeSelector(rangeSelector);
chart.drawChart(configuration); return chart;
}
}
Does anyone know how to fix this? Thanks
Last updated on
Hi,
Is it possible that your data is not sorted? Do you get any error message in the browser console?
Regards,
Guille
Last updated on
Hi! Thanks for the hint! Indeed, the data were not sorted))
Last updated on
You cannot reply to this thread.