vaadin / charts

Framework 8 version of Vaadin Charts
Other
54 stars 84 forks source link

1970 bug in charts if a null entry is available in the y-axis #586

Open TatuLund opened 5 years ago

TatuLund commented 5 years ago

I use Vaadin 8.9.0 Google Chrome Browser:Version 77.0.3865.90

if I load the data about a provider and if I have a null in the y-axis the X-axis begins at 1970. If no nulls are in it. All is fine.

If I add the same input(with nulls) direct with myDataSeries.add(new DataSeriesItem(...)) all works fine.

Can somebody fix this provider error bug or can tell a workaround?

Here my code

private DataProviderSeries getDataSeries(Configuration conf, DataProvider<T, ?> provider, ValueProvider<T, ? super Object> xColumn, ValueProvider<T, ? super Object> yColumn) { XAxis xAxis = conf.getxAxis(); xAxis.setType(AxisType.DATETIME); DataProviderSeries o = new DataProviderSeries<>(provider); PlotOptionsLine pol = new PlotOptionsLine(); pol.setConnectNulls(false); o.setPlotOptions(pol); o.setX(xColumn); o.setY(yColumn); return o; }

configuration.addSeries(getDataSeries(configuration, itemProvider, Bonitur::getDatum, Bonitur::getXXXX));

TatuLund commented 5 years ago

Copied from https://github.com/vaadin/framework/issues/11736