/** * Clears the series at the given positions, so the graph won't * be shown anymore. * * @param diagram: * The diagram containing the series to clear. * * @param clearIndex: * The positions of the series that shall be cleared */ function clearSeriesOfDiagram (diagram, clearIndex) { /* ======================================== */ // get the dataset var dataset = diagram.getChart().getXYPlot().getDataset(); // clear all series of the dataset at the given positions for (var index = 0; index < clearIndex.length; index++) { dataset.getSeries(clearIndex[index]).clear(); } /* ======================================== */ }