public void reset() { series.removeAllSeries(); seriesMap.clear(); pivotValue = 0.0d; plot.datasetChanged(new DatasetChangeEvent(this, series)); }
private void setUpGraph() { xySeriesCollection.removeAllSeries(); for (JFreePlot plot : plots) { xySeriesCollection.addSeries(plot); } graph = ChartFactory.createXYLineChart(title, // Title xLabel, // x-axis Label yLabel, // y-axis Label xySeriesCollection, // Dataset PlotOrientation.VERTICAL, // Plot Orientation false, // Show Legend true, // Use tooltips false // Configure chart to generate URLs? ); // set style for graph setUpVisuals(); // ChartPanel chartpanel = new ChartPanel(graph, true, true, true, true, true); // ChartPanel chartpanel = new ChartPanel(graph, 320, 240, 320, 240, 320, 240, true, true, true, true, true, true, true); }
private void setupData(int row0, int row1) { ChartModel model = this.model; int cols = model.getColumnCount(); XYSeriesCollection dataset = getCategory(); dataset.removeAllSeries(); for (int i = 0; i < cols; i++) { XYSeries series = new XYSeries(model.getColumnName(i), false, false); dataset.addSeries(series); } }
@Override public void actionPerformed(ActionEvent e) { xySeriesCollection.removeAllSeries(); @Override public void actionPerformed(ActionEvent e) { xySeriesCollection.removeAllSeries(); fillChart();
public void update(Planar<GrayF32> color , InterleavedU8 binary ) { // this is supposed to speed it up. not sure if it does chartHS.chart.setNotify(false); chartVS.chart.setNotify(false); chartHS.dataset.removeAllSeries(); chartVS.dataset.removeAllSeries(); XYSeries seriesHS = new XYSeries("1"); XYSeries seriesVS = new XYSeries("2"); GrayF32 H = color.getBand(0); GrayF32 S = color.getBand(1); GrayF32 V = color.getBand(2); for( int y = 0; y < binary.height; y++ ) { int index = binary.startIndex + y*binary.stride; for( int x = 0; x < binary.width; x++ ) { if( binary.data[index++] == 1 ) { float h = H.unsafe_get(x,y); float s = S.unsafe_get(x,y); float v = V.unsafe_get(x,y); seriesHS.add(h, s); seriesVS.add(v, s); } } } chartHS.dataset.addSeries(seriesHS); chartVS.dataset.addSeries(seriesVS); chartHS.chart.setNotify(true); chartVS.chart.setNotify(true); repaint(); }