Package net.sf.jasperreports.charts

Examples of net.sf.jasperreports.charts.JRBar3DPlot


        );

    configureChart(jfreeChart);

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

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

    stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    stackedBarRenderer3D.setBaseItemLabelsVisible(bar3DPlot.getShowLabels() == null ? false : bar3DPlot.getShowLabels().booleanValue());

    categoryPlot.setRenderer(stackedBarRenderer3D);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getValueAxisLineColor(), true,
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));

    return jfreeChart;
  }
View Full Code Here


          false );

    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);
   
    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getValueAxisLineColor(), true,
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));
       
    return jfreeChart;
  }
View Full Code Here

   */
  public JRBaseBar3DPlot(JRChartPlot plot, JRChart chart)
  {
    super(plot, chart);
   
    JRBar3DPlot barPlot = plot instanceof JRBar3DPlot ? (JRBar3DPlot)plot : null;
    if (barPlot == null)
    {
      categoryAxisLabelFont = new JRBaseFont(chart, null);
      categoryAxisTickLabelFont = new JRBaseFont(chart, null);
      valueAxisLabelFont = new JRBaseFont(chart, null);
      valueAxisTickLabelFont = new JRBaseFont(chart, null);
      itemLabel = new JRBaseItemLabel(null, chart);
    }
    else
    {
      categoryAxisLabelFont = new JRBaseFont(chart, barPlot.getCategoryAxisLabelFont());
      categoryAxisTickLabelFont = new JRBaseFont(chart, barPlot.getCategoryAxisTickLabelFont());
      valueAxisLabelFont = new JRBaseFont(chart, barPlot.getValueAxisLabelFont());
      valueAxisTickLabelFont = new JRBaseFont(chart, barPlot.getValueAxisTickLabelFont());
      itemLabel = new JRBaseItemLabel(barPlot.getItemLabel(), chart);
    }
  }
View Full Code Here

          false );

    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);
   
    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(),bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression())
        );

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(),bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression())
        );
   
    return jfreeChart;
  }
View Full Code Here

        );

    configureChart(jfreeChart, getPlot());

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

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

    stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    stackedBarRenderer3D.setBaseItemLabelsVisible( bar3DPlot.getShowLabels() );

    categoryPlot.setRenderer(stackedBarRenderer3D);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression())
        );


    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression())
        );

    return jfreeChart;
  }
View Full Code Here

          false );

    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);
   
    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getOwnCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));


    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getOwnValueAxisLineColor(), true,
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));
   
    return jfreeChart;
  }
View Full Code Here

        );

    configureChart(jfreeChart, getPlot());

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

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

    stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    stackedBarRenderer3D.setBaseItemLabelsVisible( bar3DPlot.getShowLabels() );

    categoryPlot.setRenderer(stackedBarRenderer3D);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
        bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
        bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
        bar3DPlot.getOwnCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
        bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
        bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
        bar3DPlot.getOwnValueAxisLineColor(), true,
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));

    return jfreeChart;
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.charts.JRBar3DPlot

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.