private JFreeChart createChart(Schedule schedule) { YIntervalSeriesCollection seriesCollection = new YIntervalSeriesCollection(); Map<Project, YIntervalSeries> projectSeriesMap = new LinkedHashMap<>( schedule.getProjectList().size()); for (Project project : schedule.getProjectList()) { YIntervalSeries projectSeries = new YIntervalSeries(project.getLabel()); seriesCollection.addSeries(projectSeries); projectSeriesMap.put(project, projectSeries); renderer.setSeriesShape(seriesIndex, new Rectangle());
/** * Returns the end x-value for an item within a series. This method * maps directly to {@link #getX(int, int)}. * * @param series the series index. * @param item the item index. * * @return The x-value. */ public Number getEndX(int series, int item) { return getX(series, item); }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * * @since 1.0.10 */ public void removeSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds."); } YIntervalSeries ts = (YIntervalSeries) this.data.get(series); ts.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); }
/** * 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(YIntervalSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); }
colSE = new XYSeriesCollection(); colCSRAvg = new YIntervalSeriesCollection(); colCERAvg = new YIntervalSeriesCollection(); colAERAvg = new YIntervalSeriesCollection(); colMERAvg = new YIntervalSeriesCollection(); colCSEAvg = new YIntervalSeriesCollection(); colSEAvg = new YIntervalSeriesCollection();
/** * 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(); }
/** * 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 YIntervalSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (YIntervalSeries) this.data.get(series); }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * * @since 1.0.10 */ public void removeSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds."); } YIntervalSeries ts = (YIntervalSeries) this.data.get(series); ts.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); }
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.10 */ public void removeAllSeries() { // Unregister the collection as a change listener to each series in // the collection. for (int i = 0; i < this.data.size(); i++) { YIntervalSeries series = (YIntervalSeries) this.data.get(i); series.removeChangeListener(this); } this.data.clear(); fireDatasetChanged(); }
colSE = new XYSeriesCollection(); colCSRAvg = new YIntervalSeriesCollection(); colCERAvg = new YIntervalSeriesCollection(); colAERAvg = new YIntervalSeriesCollection(); colMERAvg = new YIntervalSeriesCollection(); colCSEAvg = new YIntervalSeriesCollection(); colSEAvg = new YIntervalSeriesCollection();
/** * 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(); }
/** * 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 YIntervalSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Series index out of bounds"); } return (YIntervalSeries) this.data.get(series); }
/** * Initializes the upper plot. * * @return An instance of {@link XYPlot}. */ private XYPlot initializePlot() { jmxChart = new YIntervalSeriesImproved("jmx value"); YIntervalSeriesCollection yintervalseriescollection = new YIntervalSeriesCollection(); yintervalseriescollection.addSeries(jmxChart); DeviationRenderer renderer = new DeviationRenderer(true, false); renderer.setBaseShapesVisible(true); renderer.setSeriesStroke(0, new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); renderer.setSeriesFillPaint(0, new Color(255, 200, 200)); renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f)); renderer.setSeriesShape(0, new Ellipse2D.Double(-2.5, -2.5, 5.0, 5.0)); renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, DateFormat.getDateTimeInstance(), NumberFormat.getNumberInstance())); NumberAxis rangeAxis = plotDataSolver.getAxis(); subplot = new XYPlot(yintervalseriescollection, null, rangeAxis, renderer); subplot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); subplot.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); subplot.setRangeCrosshairVisible(true); return subplot; }
/** * Removes all the series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @since 1.0.10 */ public void removeAllSeries() { // Unregister the collection as a change listener to each series in // the collection. for (int i = 0; i < this.data.size(); i++) { YIntervalSeries series = (YIntervalSeries) this.data.get(i); series.removeChangeListener(this); } this.data.clear(); fireDatasetChanged(); }
/** * Returns the start x-value for an item within a series. This method * maps directly to {@link #getX(int, int)}. * * @param series the series index. * @param item the item index. * * @return The x-value. */ @Override public Number getStartX(int series, int item) { return getX(series, item); }
/** * 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(); }
/** * Initializes the upper plot with the given input data. * * @return An instance of {@link XYPlot} */ private XYPlot initializeUpperPlot() { liveThreads = new YIntervalSeriesImproved("live"); peakThreads = new YIntervalSeriesImproved("peak"); YIntervalSeriesCollection yIntervalSeriesCollection = new YIntervalSeriesCollection(); yIntervalSeriesCollection.addSeries(liveThreads); yIntervalSeriesCollection.addSeries(peakThreads); DeviationRenderer renderer = new DeviationRenderer(true, false); renderer.setBaseShapesVisible(true); renderer.setSeriesStroke(0, new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); renderer.setSeriesFillPaint(0, new Color(255, 200, 200)); renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f)); renderer.setSeriesShape(0, new Ellipse2D.Double(-2.5, -2.5, 5.0, 5.0)); renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, DateFormat.getDateTimeInstance(), NumberFormat.getNumberInstance())); final NumberAxis rangeAxis = new NumberAxis("Threads"); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setAutoRangeMinimumSize(10.0d, false); rangeAxis.setRangeType(RangeType.POSITIVE); final XYPlot subplot = new XYPlot(yIntervalSeriesCollection, null, rangeAxis, renderer); subplot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); subplot.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); subplot.setRangeCrosshairVisible(true); return subplot; }
/** * Removes a series from the collection and sends a * {@link DatasetChangeEvent} to all registered listeners. * * @param series the series (<code>null</code> not permitted). * * @since 1.0.10 */ public void removeSeries(YIntervalSeries series) { if (series == null) { throw new IllegalArgumentException("Null 'series' argument."); } if (this.data.contains(series)) { series.removeChangeListener(this); this.data.remove(series); fireDatasetChanged(); } }