/** * Returns the ending 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. * * @see #getXValue(int, int) */ public double getEndXValue(int series, int item) { return getXValue(series, item) + this.barWidth / 2.0; }
/** * Returns the ending 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. * * @see #getYValue(int, int) */ @Override public double getEndYValue(int series, int item) { return getYValue(series, item); }
/** * Receives notification of an dataset change event. * * @param event information about the event. */ public void datasetChanged(DatasetChangeEvent event) { notifyListeners(event); }
XYBarDataset ds = new XYBarDataset(dataset, 30);
private Component createChartPanel() { XYBarDataset xyBarDataset = new XYBarDataset(xyDataset, BAR_WIDTH); NumberAxis xaxis = new NumberAxis(I18n.get("statistic.histogramChartPanel.time")); NumberAxis yaxis = new NumberAxis(I18n.get("statistic.histogramChartPanel.numberOfQueries")); xaxis.setStandardTickUnits(new ChartUtils.LowerBoundedTickUnitSource(xaxis.getStandardTickUnits(), LOWER_TICK_UNIT)); XYPlot plot = new XYPlot(xyBarDataset, xaxis, yaxis, new XYBarRenderer()); JFreeChart chart = new JFreeChart(I18n.get( "statistic.histogramChartPanel.title"), null, plot, false); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setBorder(CHART_BORDER); chartPanel.setMinimumDrawHeight(0); chartPanel.setMinimumDrawWidth(0); chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE); chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE); return chartPanel; }
/** * Receives notification of an dataset change event. * * @param event information about the event. */ @Override public void datasetChanged(DatasetChangeEvent event) { notifyListeners(event); }
/** * Returns the starting 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. * * @see #getYValue(int, int) */ @Override public double getStartYValue(int series, int item) { return getYValue(series, item); }
/** * Returns the starting 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. * * @see #getXValue(int, int) */ @Override public double getStartXValue(int series, int item) { return getXValue(series, item) - this.barWidth / 2.0; }
/** * Creates and initializes the chart panel. */ public ChartPanel createChartPanel() { XYBarDataset barDataset = new XYBarDataset(dataset, BAR_WIDTH); NumberAxis xaxis = new NumberAxis(I18n.get("statistic.queryTimeHistoryPanel.time")); NumberAxis yaxis = new NumberAxis(I18n.get("statistic.queryTimeHistoryPanel.averageQueryTime")); xaxis.setStandardTickUnits(new ChartUtils.LowerBoundedTickUnitSource(xaxis.getStandardTickUnits(), LOWER_TICK_UNIT)); XYPlot plot = new XYPlot(barDataset, xaxis, yaxis, new XYBarRenderer()); JFreeChart chart = new JFreeChart(I18n.get("statistic.queryTimeHistoryPanel.queryHistory"), null, plot, false); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setBorder(CHART_BORDER); chartPanel.setMinimumDrawHeight(0); chartPanel.setMinimumDrawWidth(0); chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE); chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE); return chartPanel; }
/** * Sets the bar width and sends a {@link DatasetChangeEvent} to all * registered listeners. * * @param barWidth the bar width. * * @see #getBarWidth() * @since 1.0.4 */ public void setBarWidth(double barWidth) { this.barWidth = barWidth; notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Returns the ending 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. * * @see #getYValue(int, int) */ public double getEndYValue(int series, int item) { return getYValue(series, item); }
/** * Returns the ending 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. * * @see #getXValue(int, int) */ @Override public double getEndXValue(int series, int item) { return getXValue(series, item) + this.barWidth / 2.0; }
/** * Sets the bar width and sends a {@link DatasetChangeEvent} to all * registered listeners. * * @param barWidth the bar width. * * @see #getBarWidth() * @since 1.0.4 */ public void setBarWidth(double barWidth) { this.barWidth = barWidth; notifyListeners(new DatasetChangeEvent(this, this)); }
/** * Returns the starting 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. * * @see #getYValue(int, int) */ public double getStartYValue(int series, int item) { return getYValue(series, item); }
/** * Returns the starting 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. * * @see #getXValue(int, int) */ public double getStartXValue(int series, int item) { return getXValue(series, item) - this.barWidth / 2.0; }