Package org.jfree.chart.renderer.category

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


    configureChart(jfreeChart);

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBar3DPlot bar3DPlot = (JRBar3DPlot)getPlot();

    BarRenderer3D barRenderer3D =
      new BarRenderer3D(
        bar3DPlot.getXOffsetDouble() == null ? BarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble().doubleValue(),
        bar3DPlot.getYOffsetDouble() == null ? BarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble().doubleValue()
        );

    boolean isShowLabels = bar3DPlot.getShowLabels() == null ? false : bar3DPlot.getShowLabels().booleanValue();
    barRenderer3D.setBaseItemLabelsVisible( isShowLabels );
    if(isShowLabels)
    {
      JRItemLabel itemLabel = bar3DPlot.getItemLabel();
      JRFont font = itemLabel != null && itemLabel.getFont() != null ? itemLabel.getFont() : new JRBaseFont(getChart(), null);
      barRenderer3D.setBaseItemLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
     
      if(itemLabel != null)
      {
        if(itemLabel.getColor() != null)
        {
          barRenderer3D.setBaseItemLabelPaint(itemLabel.getColor());
        }
        else
        {
          barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
        }
//        categoryRenderer.setBaseFillPaint(itemLabel.getBackgroundColor());
//        if(itemLabel.getMask() != null)
//        {
//          barRenderer3D.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
//              StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING,
//              new DecimalFormat(itemLabel.getMask())));
//        }
//        else
//        {
          barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
//        }
      }
      else
      {
        barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
        barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
      }
    }

    categoryPlot.setRenderer(barRenderer3D);
   
View Full Code Here


  protected JFreeChart createBar3DChart() throws JRException
  {
    JFreeChart jfreeChart = super.createBar3DChart();
    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
    barRenderer3D.setItemMargin(0);
    barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
    //categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
    CategoryDataset categoryDataset = categoryPlot.getDataset();
    if(categoryDataset != null)
    {
      for(int i = 0; i < categoryDataset.getRowCount(); i++)
      {
        barRenderer3D.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
      }
    }
    return jfreeChart;
  }
View Full Code Here

  protected JFreeChart createStackedBar3DChart() throws JRException
  {
    JFreeChart jfreeChart = super.createStackedBar3DChart();
    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
    barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
    barRenderer3D.setItemMargin(0);
    CategoryDataset categoryDataset = categoryPlot.getDataset();
    if(categoryDataset != null)
    {
      for(int i = 0; i < categoryDataset.getRowCount(); i++)
      {
        barRenderer3D.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
      }
    }
    return jfreeChart;
  }
View Full Code Here

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBar3DPlot bar3DPlot = (JRBar3DPlot)getPlot();

    BarRenderer3D barRenderer3D =
      new BarRenderer3D(
        bar3DPlot.getXOffsetDouble() == null ? BarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble().doubleValue(),
        bar3DPlot.getYOffsetDouble() == null ? BarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble().doubleValue()
        );

    boolean isShowLabels = bar3DPlot.getShowLabels() == null ? false : bar3DPlot.getShowLabels().booleanValue();
    barRenderer3D.setBaseItemLabelsVisible( isShowLabels );
    if(isShowLabels)
    {
      JRItemLabel itemLabel = bar3DPlot.getItemLabel();
      JRFont font = itemLabel != null && itemLabel.getFont() != null ? itemLabel.getFont() : new JRBaseFont(getChart(), null);
      barRenderer3D.setBaseItemLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
      if(itemLabel != null)
      {
        if(itemLabel.getColor() != null)
        {
          barRenderer3D.setBaseItemLabelPaint(itemLabel.getColor());
        }
        else
        {
          barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
        }
//        categoryRenderer.setBaseFillPaint(itemLabel.getBackgroundColor());
//        if(itemLabel.getMask() != null)
//        {
//          barRenderer3D.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
//              StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING,
//              new DecimalFormat(itemLabel.getMask())));
//        }
//        else
//        {
          barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
//        }
      }
      else
      {
        barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
        barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
      }
    }

    categoryPlot.setRenderer(barRenderer3D);
   
View Full Code Here

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBar3DPlot bar3DPlot = (JRBar3DPlot)getPlot();

    BarRenderer3D barRenderer3D =
      new BarRenderer3D(
        bar3DPlot.getXOffsetDouble() == null ? BarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble().doubleValue(),
        bar3DPlot.getYOffsetDouble() == null ? BarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble().doubleValue()
        );

    boolean isShowLabels = bar3DPlot.getShowLabels() == null ? false : bar3DPlot.getShowLabels().booleanValue();
    barRenderer3D.setBaseItemLabelsVisible( isShowLabels );
    if(isShowLabels)
    {
      JRItemLabel itemLabel = bar3DPlot.getItemLabel();
      Integer baseFontSize = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BASEFONT_SIZE);
      JRFont font = itemLabel != null && itemLabel.getFont() != null ? itemLabel.getFont() : null;
      barRenderer3D.setBaseItemLabelFont(getFont(new JRBaseFont(getChart(), null), font, baseFontSize));
     
      if(itemLabel != null)
      {
        if(itemLabel.getColor() != null)
        {
          barRenderer3D.setBaseItemLabelPaint(itemLabel.getColor());
        }
        else
        {
          barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
        }
//        categoryRenderer.setBaseFillPaint(itemLabel.getBackgroundColor());
//        if(itemLabel.getMask() != null)
//        {
//          barRenderer3D.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
//              StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING,
//              new DecimalFormat(itemLabel.getMask())));
//        }
//        else
//        {
          barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
//        }
      }
      else
      {
        barRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
        barRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());
      }
    }

    categoryPlot.setRenderer(barRenderer3D);
   
View Full Code Here

  protected JFreeChart createBar3DChart() throws JRException
  {
    JFreeChart jfreeChart = super.createBar3DChart();
    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();

    barRenderer3D = new GradientBarRenderer3D(barRenderer3D);
    categoryPlot.setRenderer(barRenderer3D);

    barRenderer3D.setItemMargin(0);
    barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
    //categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);

    barRenderer3D.setItemMargin(0);

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

  protected JFreeChart createStackedBar3DChart() throws JRException
  {
    JFreeChart jfreeChart = super.createStackedBar3DChart();
    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
    barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);

    //CategoryDataset categoryDataset = categoryPlot.getDataset();
    barRenderer3D.setItemMargin(0);
    return jfreeChart;
  }
View Full Code Here

            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;
View Full Code Here

            throw new IllegalArgumentException("Null 'orientation' argument.");
        }
        CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
        ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

        BarRenderer3D renderer = new BarRenderer3D();
        if (tooltips) {
            renderer.setBaseToolTipGenerator(
                    new StandardCategoryToolTipGenerator());
        }
        if (urls) {
            renderer.setBaseItemURLGenerator(
                    new StandardCategoryURLGenerator());
        }

        CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
                renderer);
View Full Code Here

        );

    final CategoryPlot plot = chart.getCategoryPlot();
    final CategoryAxis axis = plot.getDomainAxis();
    axis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 8.0));
    final BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    return chart;

  }
View Full Code Here

TOP

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

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.