org.jfree.data.statistics.StatisticalCategoryDataset Java Examples

The following examples show how to use org.jfree.data.statistics.StatisticalCategoryDataset. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StatisticalBarChartBuilder.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Override
public JFreeChart createChartImpl(String title, String xAxisTitle, String yAxisTitle, final Dataset dataset,
        PlotOrientation plotOrientation, boolean showLegend, boolean showToolTips, boolean showUrls)
{
    CategoryAxis xAxis = new CategoryAxis(xAxisTitle);
    ValueAxis yAxis = new NumberAxis(yAxisTitle);
    CategoryItemRenderer renderer = new StatisticalBarRenderer();

    CategoryPlot plot = new CategoryPlot((StatisticalCategoryDataset) dataset, xAxis, yAxis, renderer);

    JFreeChart chart = new JFreeChart(title, new Font("Arial", Font.PLAIN, 10), plot, true);

    chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);

    return chart;
}
 
Example #2
Source File: StatisticalBarRenderer.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}
 
Example #3
Source File: StatisticalBarRenderer.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}
 
Example #4
Source File: StatisticalBarRenderer.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}
 
Example #5
Source File: Nopol2017_004_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
 
Example #6
Source File: Nopol2017_004_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (0 == 1) {
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
}
 
Example #7
Source File: Chart_25_StatisticalBarRenderer_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
 
Example #8
Source File: Chart_25_StatisticalBarRenderer_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
 
Example #9
Source File: StatisticalBarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}
 
Example #10
Source File: StatisticalBarRenderer.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param selected  is the item selected?
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
        boolean selected, int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(dataset instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statDataset
            = (StatisticalCategoryDataset) dataset;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statDataset, visibleRow, row, column, selected);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statDataset, visibleRow, row, column, selected);
    }
}
 
Example #11
Source File: StatisticalBarRenderer.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
 
Example #12
Source File: StatisticalBarRenderer.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single 
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int row,
                     int column,
                     int pass) {

    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis, 
                rangeAxis, statData, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                statData, row, column);
    }
}
 
Example #13
Source File: StatisticalBarRenderer.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}
 
Example #14
Source File: StatisticalBarRenderer.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Draws the bar with its standard deviation line range for a single
 * (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param data  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset data, int row, int column,
        int pass) {

    int visibleRow = state.getVisibleSeriesIndex(row);
    if (visibleRow < 0) {
        return;
    }
    // defensive check
    if (!(data instanceof StatisticalCategoryDataset)) {
        throw new IllegalArgumentException(
            "Requires StatisticalCategoryDataset.");
    }
    StatisticalCategoryDataset statData = (StatisticalCategoryDataset) data;

    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, state, dataArea, plot, domainAxis,
                rangeAxis, statData, visibleRow, row, column);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                statData, visibleRow, row, column);
    }
}