/** * Adds a new series of the specified type. * * @param type The plot type. * @return The new series. */ public PlotOptions addSeries(PlotType type) { PlotOptions plot = type.newInstance(); instance.data.datasets.add(plot); plot.borderColor = colorIterator.next(); plot.backgroundColor = "transparent"; return plot; }
/** * Removes all series and data points and destroys the client graph. */ public void clear() { running = false; colorIterator.reset(); invoke("_reset"); }
@Test public void testCyclicIterator() { Iterator<Integer> iter = new CyclicIterator<>(CYCLIC_COLLECTION); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { assertEquals(j, iter.next().intValue()); } } }