/** * Receives a change event from the underlying dataset and responds by * firing a change event for this dataset. * * @param event the event. */ @Override public void datasetChanged(DatasetChangeEvent event) { fireDatasetChanged(); }
/** * Returns the ending value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval end. */ public double getEndYValue(int series, int item) { if (!this.transposed) { return getItemEndValue(series, item); } else { return getSeriesEndValue(series); } }
/** * Returns the starting value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval start. */ public double getStartYValue(int series, int item) { if (!this.transposed) { return getItemStartValue(series, item); } else { return getSeriesStartValue(series); } }
/** * Returns the x-value (as a double primitive) for an item within a series. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The value. */ public double getXValue(int series, int item) { if (!this.transposed) { return getSeriesValue(series); } else { return getItemValue(series, item); } }
/** * Returns the ending value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval end. */ public Number getEndY(int series, int item) { return new Double(getEndYValue(series, item)); }
/** * Returns the ending date/time for the specified item (task) in the * given series, measured in milliseconds since 1-Jan-1970 (as in * java.util.Date). * * @param series the series index. * @param item the item (or task) index. * * @return The end date/time. */ public Number getEndX(int series, int item) { return new Double(getEndXValue(series, item)); }
public static JFreeChart chartSchedule(Collection<? extends Vehicle> vehicles, DescriptionCreator descriptionCreator, PaintSelector paintSelector) { // data TaskSeriesCollection dataset = createScheduleDataset(vehicles, descriptionCreator); XYTaskDataset xyTaskDataset = new XYTaskDataset(dataset); // chart JFreeChart chart = ChartFactory.createXYBarChart("Schedules", "Time", false, "Vehicles", xyTaskDataset, PlotOrientation.HORIZONTAL, false, true, false); XYPlot plot = (XYPlot)chart.getPlot(); // Y axis String[] series = new String[vehicles.size()]; int i = 0; for (Vehicle v : vehicles) { series[i++] = v.getId().toString(); } SymbolAxis symbolAxis = new SymbolAxis("Vehicles", series); symbolAxis.setGridBandsVisible(false); plot.setDomainAxis(symbolAxis); // X axis plot.setRangeAxis(new DateAxis("Time", TimeZone.getTimeZone("GMT"), Locale.getDefault())); // Renderer XYBarRenderer xyBarRenderer = new ChartTaskRenderer(dataset, paintSelector); xyBarRenderer.setUseYInterval(true); plot.setRenderer(xyBarRenderer); return chart; }
/** * Returns the y-value (as a double primitive) for an item within a series. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The value. */ @Override public double getYValue(int series, int item) { if (!this.transposed) { return getItemValue(series, item); } else { return getSeriesValue(series); } }
/** * Returns the ending value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval end. */ @Override public Number getEndY(int series, int item) { return new Double(getEndYValue(series, item)); }
/** * Returns the ending date/time for the specified item (task) in the * given series, measured in milliseconds since 1-Jan-1970 (as in * java.util.Date). * * @param series the series index. * @param item the item (or task) index. * * @return The end date/time. */ @Override public Number getEndX(int series, int item) { return new Double(getEndXValue(series, item)); }
dataset = new XYTaskDataset(createTasks(ofxChart.getDataSet()));
/** * Returns the x-value (as a double primitive) for an item within a series. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The value. */ @Override public double getXValue(int series, int item) { if (!this.transposed) { return getSeriesValue(series); } else { return getItemValue(series, item); } }
/** * Returns the starting value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval start. */ @Override public double getStartYValue(int series, int item) { if (!this.transposed) { return getItemStartValue(series, item); } else { return getSeriesStartValue(series); } }
/** * Returns the ending value of the y-interval for an item in the * given series. * * @param series the series index. * @param item the item (or task) index. * * @return The y-interval end. */ @Override public double getEndYValue(int series, int item) { if (!this.transposed) { return getItemEndValue(series, item); } else { return getSeriesEndValue(series); } }
/** * Sets the flag that controls whether or not the dataset is transposed * and sends a {@link DatasetChangeEvent} to all registered listeners. * * @param transposed the new flag value. * * @see #isTransposed() */ public void setTransposed(boolean transposed) { this.transposed = transposed; fireDatasetChanged(); }
/** * Returns the y-value (as a double primitive) for an item within a series. * * @param series the series index (zero-based). * @param item the item index (zero-based). * * @return The value. */ public double getYValue(int series, int item) { if (!this.transposed) { return getItemValue(series, item); } else { return getSeriesValue(series); } }
/** * Returns the starting date/time for the specified item (task) in the * given series, measured in milliseconds since 1-Jan-1970 (as in * java.util.Date). * * @param series the series index. * @param item the item (or task) index. * * @return The start date/time. */ @Override public double getStartXValue(int series, int item) { if (!this.transposed) { return getSeriesStartValue(series); } else { return getItemStartValue(series, item); } }
/** * Returns the ending date/time for the specified item (task) in the * given series, measured in milliseconds since 1-Jan-1970 (as in * java.util.Date). * * @param series the series index. * @param item the item (or task) index. * * @return The end date/time. */ @Override public double getEndXValue(int series, int item) { if (!this.transposed) { return getSeriesEndValue(series); } else { return getItemEndValue(series, item); } }
/** * Receives a change event from the underlying dataset and responds by * firing a change event for this dataset. * * @param event the event. */ public void datasetChanged(DatasetChangeEvent event) { fireDatasetChanged(); }
/** * Returns the starting date/time for the specified item (task) in the * given series, measured in milliseconds since 1-Jan-1970 (as in * java.util.Date). * * @param series the series index. * @param item the item (or task) index. * * @return The start date/time. */ public double getStartXValue(int series, int item) { if (!this.transposed) { return getSeriesStartValue(series); } else { return getItemStartValue(series, item); } }