Package org.jfree.chart.renderer.category

Examples of org.jfree.chart.renderer.category.BarRenderer


    categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
    categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);

    BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
    categoryRenderer.setShadowVisible(false);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
        barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
        barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
View Full Code Here


      barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
      barPlot.getOwnValueAxisLineColor(), true,
      (Comparable)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
      (Comparable)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

    BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
    categoryRenderer.setShadowVisible(false);

    return jfreeChart;
  }
View Full Code Here

  {
    JFreeChart jfreeChart = super.createBarChart();

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    //categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
    BarRenderer barRenderer = (BarRenderer)categoryPlot.getRenderer();
    barRenderer.setItemMargin(0);
    barRenderer.setGradientPaintTransformer(
      new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
      );
    CategoryDataset categoryDataset = categoryPlot.getDataset();
    if(categoryDataset != null)
    {
      for(int i = 0; i < categoryDataset.getRowCount(); i++)
      {
        barRenderer.setSeriesPaint(i, (Paint)ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
      }
    }
    return jfreeChart;
  }
View Full Code Here

  {
    JFreeChart jfreeChart = super.createStackedBarChart();

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    //categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
    BarRenderer barRenderer = (BarRenderer)categoryPlot.getRenderer();
    barRenderer.setItemMargin(0);
    barRenderer.setGradientPaintTransformer(
      new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
      );

    CategoryDataset categoryDataset = categoryPlot.getDataset();
    if(categoryDataset != null)
    {
      for(int i = 0; i < categoryDataset.getRowCount(); i++)
      {
        barRenderer.setSeriesPaint(i, (Paint)ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
      }
    }
    return jfreeChart;
  }
View Full Code Here

        //barPlot.isShowTickLabels()
        true
        );
    CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelsVisible(true);
    BarRenderer barRenderer = (BarRenderer)categoryRenderer;
    barRenderer.setSeriesPaint(0, (Paint)ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(3));
    barRenderer.setSeriesPaint(1, (Paint)ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(0));
    CategoryDataset categoryDataset = categoryPlot.getDataset();
    if(categoryDataset != null)
    {
      for(int i = 0; i < categoryDataset.getRowCount(); i++)
      {
        barRenderer.setSeriesItemLabelFont(i, categoryPlot.getDomainAxis().getTickLabelFont());
        barRenderer.setSeriesItemLabelsVisible(i, true);
      }
    }
    categoryPlot.setOutlinePaint(Color.DARK_GRAY);
    categoryPlot.setOutlineStroke(new BasicStroke(1.5f));
    categoryPlot.setOutlineVisible(true);
View Full Code Here

public class BarChartCustomizer implements JRChartCustomizer
{

  public void customize(JFreeChart chart, JRChart jasperChart)
  {
    BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
    renderer.setSeriesPaint(0, Color.green);
    renderer.setSeriesPaint(1, Color.orange);
  }
View Full Code Here

public class BarChartCustomizer implements JRChartCustomizer
{

  public void customize(JFreeChart chart, JRChart jasperChart)
  {
    BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
    renderer.setSeriesPaint(0, Color.green);
    renderer.setSeriesPaint(1, Color.orange);
  }
View Full Code Here

        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        rangeAxis.setUpperMargin(0.0);
       
        // disable bar outlines...
        BarRenderer renderer = (BarRenderer) plot.getRenderer();
        renderer.setDrawBarOutline(false);
       
        // set up gradient paints for series...
        GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
        Paint gp1 = new Color(0, 0, 0, 0);
        GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, new Color(64, 0, 0));
        //renderer.setSeriesPaint(0, gp0);
  renderer.setSeriesPaint(0, Color.green);
        renderer.setSeriesPaint(1, gp1);
        //renderer.setSeriesPaint(2, gp2);
  renderer.setSeriesPaint(2, Color.red);
       
        return chart;       
    }
View Full Code Here

      final CategoryItemRenderer renderer = categoryPlot.getRenderer();
      renderer.setBaseOutlinePaint(WidgetUtils.BG_COLOR_DARK);
      renderer.setBaseOutlineStroke(wideStroke);

      if (renderer instanceof BarRenderer) {
        BarRenderer barRenderer = (BarRenderer) renderer;
        barRenderer.setShadowPaint(WidgetUtils.BG_COLOR_BRIGHT);
        barRenderer.setBarPainter(new StandardBarPainter());
      }

    } else if (plot instanceof XYPlot) {
      // tweaks for line charts
      final XYPlot xyPlot = (XYPlot) plot;
View Full Code Here

        // set the range axis to display integers only...
        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        // disable bar outlines...
        BarRenderer renderer = (BarRenderer) plot.getRenderer();
        // renderer.setDrawBarOutline(false);

        // set up gradient paints for series...
        GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f,
                0.0f, new Color(0, 0, 64));
        GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f,
                0.0f, new Color(0, 64, 0));
        GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f,
                0.0f, new Color(64, 0, 0));
        renderer.setSeriesPaint(0, gp0);
        renderer.setSeriesPaint(1, gp1);
        renderer.setSeriesPaint(2, gp2);

        CategoryAxis domainAxis = plot.getDomainAxis();
        domainAxis.setCategoryLabelPositions(CategoryLabelPositions
                .createUpRotationLabelPositions(Math.PI / 6.0));
        // OPTIONAL CUSTOMISATION COMPLETED.
View Full Code Here

TOP

Related Classes of org.jfree.chart.renderer.category.BarRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.