You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chart zooming doesn't work correct for Y axis if the ticks are set with setTickPositions function.
There is a small example with two charts. The first one the ticks are set with setTickInterval and setMin, setMaxFunction and everything is working correctly. On the second one the ticks are set via setTickPositions function. And zooming on y axis doesn't work correct.
public MainView() {
Chart chart1 = new Chart();
Configuration configuration1 = chart1.getConfiguration();
configuration1.getChart().setType(ChartType.LINE);
configuration1.getTitle()
.setText("Ticks on Axes are set with setTickInterval");
configuration1.getChart().setZoomType(Dimension.XY);
configuration1.getxAxis().setTickInterval(1);
configuration1.getxAxis().setMin(0);
configuration1.getxAxis().setMax(5);
configuration1.getyAxis().setTickInterval(1);
configuration1.getyAxis().setMin(0);
configuration1.getyAxis().setMax(5);
DataSeries ds1 = new DataSeries();
ds1.add(new DataSeriesItem(1, 1));
ds1.add(new DataSeriesItem(2, 2));
ds1.add(new DataSeriesItem(3, 2));
ds1.add(new DataSeriesItem(4, 1));
configuration1.addSeries(ds1);
Chart chart2 = new Chart();
Configuration configuration2 = chart2.getConfiguration();
configuration2.getChart().setType(ChartType.LINE);
configuration2.getTitle()
.setText("Ticks on Axes are set with setTickPosition");
configuration2.getChart().setZoomType(Dimension.XY);
configuration2.getxAxis().setTickPositions(new Double [] {0.0, 1.00, 2.0, 3.0, 4.0, 5.0});
configuration2.getxAxis().setMin(0);
configuration2.getxAxis().setMax(5);
configuration2.getyAxis().setTitle(new AxisTitle("Y"));
configuration2.getyAxis().setTickPositions(new Double[] {0.0, 1.0, 2.0, 3.0, 4.0, 5.0});
DataSeries ds2 = new DataSeries();
ds2.add(new DataSeriesItem(1, 1));
ds2.add(new DataSeriesItem(2, 2));
ds2.add(new DataSeriesItem(3, 2));
ds2.add(new DataSeriesItem(4, 1));
configuration2.addSeries(ds2);
VerticalLayout charts = new VerticalLayout();
charts.add(chart1);
charts.add(chart2);
add(charts);
}
The text was updated successfully, but these errors were encountered:
Chart zooming doesn't work correct for Y axis if the ticks are set with setTickPositions function.
There is a small example with two charts. The first one the ticks are set with setTickInterval and setMin, setMaxFunction and everything is working correctly. On the second one the ticks are set via setTickPositions function. And zooming on y axis doesn't work correct.
The text was updated successfully, but these errors were encountered: