Search in sources :

Example 1 with StatisticalBarRenderer

use of org.jfree.chart.renderer.category.StatisticalBarRenderer in project SIMVA-SoS by SESoS.

the class StandardChartTheme method applyToCategoryItemRenderer.

/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");
    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }
    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);
    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }
    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }
    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }
    // StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }
    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
Also used : MinMaxCategoryRenderer(org.jfree.chart.renderer.category.MinMaxCategoryRenderer) BarRenderer3D(org.jfree.chart.renderer.category.BarRenderer3D) LineRenderer3D(org.jfree.chart.renderer.category.LineRenderer3D) StatisticalBarRenderer(org.jfree.chart.renderer.category.StatisticalBarRenderer) AbstractRenderer(org.jfree.chart.renderer.AbstractRenderer) StatisticalBarRenderer(org.jfree.chart.renderer.category.StatisticalBarRenderer) BarRenderer(org.jfree.chart.renderer.category.BarRenderer) XYBarRenderer(org.jfree.chart.renderer.xy.XYBarRenderer)

Example 2 with StatisticalBarRenderer

use of org.jfree.chart.renderer.category.StatisticalBarRenderer in project qpid-broker-j by apache.

the class StatisticalBarChartBuilder method createChartImpl.

@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;
}
Also used : NumberAxis(org.jfree.chart.axis.NumberAxis) StatisticalBarRenderer(org.jfree.chart.renderer.category.StatisticalBarRenderer) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryAxis(org.jfree.chart.axis.CategoryAxis) ValueAxis(org.jfree.chart.axis.ValueAxis) CategoryPlot(org.jfree.chart.plot.CategoryPlot) JFreeChart(org.jfree.chart.JFreeChart) Font(java.awt.Font)

Aggregations

StatisticalBarRenderer (org.jfree.chart.renderer.category.StatisticalBarRenderer)2 Font (java.awt.Font)1 JFreeChart (org.jfree.chart.JFreeChart)1 CategoryAxis (org.jfree.chart.axis.CategoryAxis)1 NumberAxis (org.jfree.chart.axis.NumberAxis)1 ValueAxis (org.jfree.chart.axis.ValueAxis)1 CategoryPlot (org.jfree.chart.plot.CategoryPlot)1 AbstractRenderer (org.jfree.chart.renderer.AbstractRenderer)1 BarRenderer (org.jfree.chart.renderer.category.BarRenderer)1 BarRenderer3D (org.jfree.chart.renderer.category.BarRenderer3D)1 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)1 LineRenderer3D (org.jfree.chart.renderer.category.LineRenderer3D)1 MinMaxCategoryRenderer (org.jfree.chart.renderer.category.MinMaxCategoryRenderer)1 XYBarRenderer (org.jfree.chart.renderer.xy.XYBarRenderer)1