/** * Returns the key for a series. * * @param series the series index (in the range {@code 0} to * {@code getSeriesCount() - 1}). * * @return The key for a series. * * @throws IllegalArgumentException if {@code series} is not in the * specified range. */ @Override public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }
/** * Returns a series from the collection. * * @param series the series index (zero-based). * * @return The series. * * @throws IllegalArgumentException if {@code series} is not in the * range {@code 0} to {@code getSeriesCount() - 1}. */ public VectorSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (VectorSeries) this.data.get(series); }
/** * Returns the x-value for an item within a series. Note that this method * creates a new {@link Double} instance every time it is called---use * {@link #getXValue(int, int)} instead, if possible. * * @param series the series index. * @param item the item index. * * @return The x-value. */ public Number getX(int series, int item) { return new Double(getXValue(series, item)); }
int sercnt = dataset.getSeriesCount(); Integer sernum = (Integer)seriesmap.get(seriesname); if(sernum!=null) seriesmap.put(Integer.valueOf(j), Integer.valueOf(j)); dataset.addSeries(series); VectorSeries ser = dataset.getSeries(seriesnum);
/** * Adds a series to the collection and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param series the series (<code>null</code> not permitted). */ public void addSeries(VectorSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); }
/** * Returns the y-value for an item within a series. Note that this method * creates a new {@link Double} instance every time it is called---use * {@link #getYValue(int, int)} instead, if possible. * * @param series the series index. * @param item the item index. * * @return The y-value. */ public Number getY(int series, int item) { return new Double(getYValue(series, item)); }
boolean autorepaint = getProperty("autorepaint")==null? false: ((Boolean)getProperty("autorepaint")).booleanValue(); XYDataset dataset = new VectorSeriesCollection(); JFreeChart chart = ChartFactory.createXYLineChart(title, labelx, labely, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls); chart.setNotify(autorepaint);
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. */ public void removeAllSeries() { // deregister the collection as a change listener to each series in the // collection for (int i = 0; i < this.data.size(); i++) { VectorSeries series = (VectorSeries) this.data.get(i); series.removeChangeListener(this); } // remove all the series from the collection and notify listeners. this.data.clear(); fireDatasetChanged(); }
/** * Returns the y-value for an item within a series. Note that this method * creates a new {@link Double} instance every time it is called---use * {@link #getYValue(int, int)} instead, if possible. * * @param series the series index. * @param item the item index. * * @return The y-value. */ @Override public Number getY(int series, int item) { return new Double(getYValue(series, item)); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if {@code series} is not in the * range {@code 0} to {@code getSeriesCount() - 1}. */ @Override public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. */ public void removeAllSeries() { // deregister the collection as a change listener to each series in the // collection for (int i = 0; i < this.data.size(); i++) { VectorSeries series = (VectorSeries) this.data.get(i); series.removeChangeListener(this); } // remove all the series from the collection and notify listeners. this.data.clear(); fireDatasetChanged(); }
/** * Returns a series from the collection. * * @param series the series index (zero-based). * * @return The series. * * @throws IllegalArgumentException if <code>series</code> is not in the * range <code>0</code> to <code>getSeriesCount() - 1</code>. */ public VectorSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (VectorSeries) this.data.get(series); }
/** * Returns the x-value for an item within a series. Note that this method * creates a new {@link Double} instance every time it is called---use * {@link #getXValue(int, int)} instead, if possible. * * @param series the series index. * @param item the item index. * * @return The x-value. */ @Override public Number getX(int series, int item) { return new Double(getXValue(series, item)); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if <code>series</code> is not in the * range <code>0</code> to <code>getSeriesCount() - 1</code>. */ public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
/** * Removes the specified series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series (<code>null</code> not permitted). * * @return A boolean indicating whether the series has actually been * removed. */ public boolean removeSeries(VectorSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } boolean removed = this.data.remove(series); if (removed) { series.removeChangeListener(this); fireDatasetChanged(); } return removed; }
/** * Returns the key for a series. * * @param series the series index (in the range <code>0</code> to * <code>getSeriesCount() - 1</code>). * * @return The key for a series. * * @throws IllegalArgumentException if <code>series</code> is not in the * specified range. */ public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }
/** * Adds a series to the collection and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param series the series ({@code null} not permitted). */ public void addSeries(VectorSeries series) { Args.nullNotPermitted(series, "series"); this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); }
/** * Removes the specified series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series ({@code null} not permitted). * * @return A boolean indicating whether the series has actually been * removed. */ public boolean removeSeries(VectorSeries series) { Args.nullNotPermitted(series, "series"); boolean removed = this.data.remove(series); if (removed) { series.removeChangeListener(this); fireDatasetChanged(); } return removed; }