/** * Removes a series from the collection. * * @param index the series index (zero-based). */ public void removeSeries(int index) { TimePeriodValues series = getSeries(index); if (series != null) { removeSeries(series); } }
/** * Returns a series. * * @param series the index of the series (zero-based). * * @return The series. */ public TimePeriodValues getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Index 'series' out of range."); } return (TimePeriodValues) this.data.get(series); }
public Dataset getCustomDataset() { TimePeriodValuesCollection dataset = new TimePeriodValuesCollection(); if (seriesNames != null) { for(int i = 0; i < seriesNames.size(); i++) { Comparable seriesName = (Comparable)seriesNames.get(i); dataset.addSeries((TimePeriodValues)seriesMap.get(seriesName)); } } return dataset; }
while (dataset.getSeriesCount() != 0) { dataset.removeSeries(0); dataset.addSeries(total); Integer minColumn = null; if (jWalletBalance.isSelected() && walletColumn != null) { render.add(dataset.getSeriesCount() - 1, minColumn); updateRender(dataset.getSeriesCount() - 1, Color.RED.darker()); dataset.addSeries(walletBalance); render.add(dataset.getSeriesCount() - 1, walletColumn); updateRender(dataset.getSeriesCount() - 1, Color.BLUE.darker()); dataset.addSeries(assets); render.add(dataset.getSeriesCount() - 1, assetColumn); updateRender(dataset.getSeriesCount() - 1, Color.GREEN.darker().darker()); dataset.addSeries(sellOrders); updateRender(dataset.getSeriesCount() - 1, Color.CYAN.darker()); dataset.addSeries(escrows); updateRender(dataset.getSeriesCount() - 1, Color.BLACK); dataset.addSeries(escrowsToCover); updateRender(dataset.getSeriesCount() - 1, Color.GRAY); dataset.addSeries(manufacturing); updateRender(dataset.getSeriesCount() - 1, Color.MAGENTA);
/** * Returns the key for a series. * * @param series the index of the series (zero-based). * * @return The key for a series. */ public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }
/** * Returns the starting Y value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The starting Y value for the specified series and item. */ public Number getStartY(int series, int item) { return getY(series, item); }
/** * Removes the specified series from the collection. * * @param series the series to remove (<code>null</code> not permitted). */ public void removeSeries(TimePeriodValues series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.remove(series); series.removeChangeListener(this); fireDatasetChanged(); }
/** * Returns the minimum x-value in the dataset. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The minimum value. */ public double getDomainLowerBound(boolean includeInterval) { double result = Double.NaN; Range r = getDomainBounds(includeInterval); if (r != null) { result = r.getLowerBound(); } return result; }
/** * Returns the x-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The x-value for the specified series and item. */ public Number getX(int series, int item) { TimePeriodValues ts = (TimePeriodValues) this.data.get(series); TimePeriodValue dp = ts.getDataItem(item); TimePeriod period = dp.getPeriod(); return new Long(getX(period)); }
/** * Returns the key for a series. * * @param series the index of the series (zero-based). * * @return The key for a series. */ @Override public Comparable getSeriesKey(int series) { // defer argument checking return getSeries(series).getKey(); }
/** * Returns the starting Y value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The starting Y value for the specified series and item. */ @Override public Number getStartY(int series, int item) { return getY(series, item); }
/** * Adds a series to the collection. A * {@link org.jfree.data.general.DatasetChangeEvent} is sent to all * registered listeners. * * @param series the time series. */ public void addSeries(TimePeriodValues series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); }
/** * Returns the minimum x-value in the dataset. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The minimum value. */ @Override public double getDomainLowerBound(boolean includeInterval) { double result = Double.NaN; Range r = getDomainBounds(includeInterval); if (r != null) { result = r.getLowerBound(); } return result; }
/** * Returns the x-value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The x-value for the specified series and item. */ @Override public Number getX(int series, int item) { TimePeriodValues ts = (TimePeriodValues) this.data.get(series); TimePeriodValue dp = ts.getDataItem(item); TimePeriod period = dp.getPeriod(); return new Long(getX(period)); }
/** * Removes a series from the collection. * * @param index the series index (zero-based). */ public void removeSeries(int index) { TimePeriodValues series = getSeries(index); if (series != null) { removeSeries(series); } }
/** * Returns the number of items in the specified series. * <P> * This method is provided for convenience. * * @param series the index of the series of interest (zero-based). * * @return The number of items in the specified series. */ public int getItemCount(int series) { return getSeries(series).getItemCount(); }
TimePeriodValuesCollection dataset = new TimePeriodValuesCollection(); dataset.addSeries(series1); dataset.addSeries(series2);
/** * Returns a series. * * @param series the index of the series (zero-based). * * @return The series. */ public TimePeriodValues getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Index 'series' out of range."); } return (TimePeriodValues) this.data.get(series); }
/** * Returns the ending Y value for the specified series and item. * * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The ending Y value for the specified series and item. */ @Override public Number getEndY(int series, int item) { return getY(series, item); }
/** * Removes the specified series from the collection. * * @param series the series to remove ({@code null} not permitted). */ public void removeSeries(TimePeriodValues series) { Args.nullNotPermitted(series, "series"); this.data.remove(series); series.removeChangeListener(this); fireDatasetChanged(); }