@Test public void generateXticks_NO_POINT_IN_SERIES() { Chart<Object, Number> chart = new Chart<>(); chart.addSeries(new Series<>()); assertEquals(0, flotXticksGenerator.generateXticks(new Chart<>()).size()); }
public List<Object[]> generateXticks(Chart<?, Number> chart) { Preconditions.checkNotNull(chart); List<Object[]> xticks = Lists.newArrayList(); if (CollectionUtils.isEmpty(chart.getSeriesList())) { return xticks; } Series<?, Number> series = chart.getSeriesList().get(0); if (series == null) { return xticks; } for (int i=0; i < series.getPoints().size(); i++) { Point<?, Number> point = series.getPoints().get(i); xticks.add(new Object[] {i, point.getX()}); } return xticks; }
FlotXticksGenerator { public List<Object[]> generateXticks(Chart<?, Number> chart) { Preconditions.checkNotNull(chart); List<Object[]> xticks = Lists.newArrayList(); if (CollectionUtils.isEmpty(chart.getSeriesList())) { return xticks; } Series<?, Number> series = chart.getSeriesList().get(0); if (series == null) { return xticks; } for (int i=0; i < series.getPoints().size(); i++) { Point<?, Number> point = series.getPoints().get(i); xticks.add(new Object[] {i, point.getX()}); } return xticks; } }
FlotXticksGenerator { public List<Object[]> generateXticks(Chart<?, Number> chart) { Preconditions.checkNotNull(chart); List<Object[]> xticks = Lists.newArrayList(); if (CollectionUtils.isEmpty(chart.getSeriesList())) { return xticks; } Series<?, Number> series = chart.getSeriesList().get(0); if (series == null) { return xticks; } for (int i=0; i < series.getPoints().size(); i++) { Point<?, Number> point = series.getPoints().get(i); xticks.add(new Object[] {i, point.getX()}); } return xticks; }  }
FlotXticksGenerator { public List<Object[]> generateXticks(Chart<?, Number> chart) { Preconditions.checkNotNull(chart); List<Object[]> xticks = Lists.newArrayList(); if (CollectionUtils.isEmpty(chart.getSeriesList())) { return xticks; } Series<?, Number> series = chart.getSeriesList().get(0); if (series == null) { return xticks; } for (int i=0; i < series.getPoints().size(); i++) { Point<?, Number> point = series.getPoints().get(i); xticks.add(new Object[] {i, point.getX()}); } return xticks; }  List<Object[]> generateXticks(Chart<?, Number> chart); }
FlotXticksGenerator { public List<Object[]> generateXticks(Chart<?, Number> chart) { Preconditions.checkNotNull(chart); List<Object[]> xticks = Lists.newArrayList(); if (CollectionUtils.isEmpty(chart.getSeriesList())) { return xticks; } Series<?, Number> series = chart.getSeriesList().get(0); if (series == null) { return xticks; } for (int i=0; i < series.getPoints().size(); i++) { Point<?, Number> point = series.getPoints().get(i); xticks.add(new Object[] {i, point.getX()}); } return xticks; }  List<Object[]> generateXticks(Chart<?, Number> chart);  }