Package org.jfree.chart

Examples of org.jfree.chart.JFreeChart


   *
   */
  protected JFreeChart createAreaChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createAreaChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRAreaPlot)getPlot()).getCategoryAxisLabelExpression()),
        (String)evaluateExpression(((JRAreaPlot)getPlot()).getValueAxisLabelExpression()),
        (CategoryDataset)getDataset(),
        getPlot().getOrientation(),
        isShowLegend(),
        true,
        false);

    configureChart(jfreeChart, getPlot());
    JRAreaPlot areaPlot = (JRAreaPlot)getPlot();
    // Handle the axis formating for the category axis
    configureAxis(((CategoryPlot)jfreeChart.getPlot()).getDomainAxis(), areaPlot.getCategoryAxisLabelFont(),
        areaPlot.getCategoryAxisLabelColor(), areaPlot.getCategoryAxisTickLabelFont(),
        areaPlot.getCategoryAxisTickLabelColor(), areaPlot.getCategoryAxisTickLabelMask(), areaPlot.getCategoryAxisVerticalTickLabels(),
        areaPlot.getOwnCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(areaPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(areaPlot.getDomainAxisMaxValueExpression()));

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



  protected JFreeChart createBar3DChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createBarChart3D(
          (String)evaluateExpression(getChart().getTitleExpression()),
          (String)evaluateExpression(((JRBar3DPlot)getPlot()).getCategoryAxisLabelExpression()),
          (String)evaluateExpression(((JRBar3DPlot)getPlot()).getValueAxisLabelExpression()),
          (CategoryDataset)getDataset(),
          getPlot().getOrientation(),
          isShowLegend(),
          true,
          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(),
View Full Code Here

   *
   */
  protected JFreeChart createBarChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createBarChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
        (String)evaluateExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
        (CategoryDataset)getDataset(),
        getPlot().getOrientation(),
        isShowLegend(),
        true,
        false
        );

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    //plot.setNoDataMessage("No data to display");
   
    JRBarPlot barPlot = (JRBarPlot)getPlot();
    boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
    boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
View Full Code Here


  protected JFreeChart createBubbleChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createBubbleChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRBubblePlot)getPlot()).getXAxisLabelExpression()),
        (String)evaluateExpression(((JRBubblePlot)getPlot()).getYAxisLabelExpression()),
         (XYZDataset)getDataset(),
         getPlot().getOrientation(),
         isShowLegend(),
         true,
         false);

    configureChart(jfreeChart, getPlot());

    XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
    JRBubblePlot bubblePlot = (JRBubblePlot)getPlot();
    int scaleType = bubblePlot.getScaleTypeValue() == null ? ScaleTypeEnum.ON_RANGE_AXIS.getValue() : bubblePlot.getScaleTypeValue().getValue();
    XYBubbleRenderer bubbleRenderer = new XYBubbleRenderer( scaleType );
    xyPlot.setRenderer( bubbleRenderer );
View Full Code Here

   * @throws net.sf.jasperreports.engine.JRException
   */
  protected JFreeChart createCandlestickChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createCandlestickChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRCandlestickPlot)getPlot()).getTimeAxisLabelExpression()),
        (String)evaluateExpression(((JRCandlestickPlot)getPlot()).getValueAxisLabelExpression()),
        (DefaultHighLowDataset)getDataset(),
        isShowLegend()
        );

    configureChart(jfreeChart, getPlot());

    XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
    JRCandlestickPlot candlestickPlot = (JRCandlestickPlot)getPlot();
    CandlestickRenderer candlestickRenderer = (CandlestickRenderer) xyPlot.getRenderer();
    boolean isShowVolume = candlestickPlot.getShowVolume() == null ? true : candlestickPlot.getShowVolume().booleanValue();
    candlestickRenderer.setDrawVolume(isShowVolume);

View Full Code Here

   * @throws JRException
   */
  protected JFreeChart createHighLowChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createHighLowChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRHighLowPlot)getPlot()).getTimeAxisLabelExpression()),
        (String)evaluateExpression(((JRHighLowPlot)getPlot()).getValueAxisLabelExpression()),
        (DefaultHighLowDataset)getDataset(),
        isShowLegend()
        );

    configureChart(jfreeChart, getPlot());
    XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
    JRHighLowPlot highLowPlot = (JRHighLowPlot)getPlot();
    HighLowRenderer hlRenderer = (HighLowRenderer) xyPlot.getRenderer();
    boolean isShowOpenTicks = highLowPlot.getShowOpenTicks() == null ? false : highLowPlot.getShowOpenTicks().booleanValue();
    boolean isShowCloseTicks = highLowPlot.getShowCloseTicks() == null ? false : highLowPlot.getShowCloseTicks().booleanValue();
   
View Full Code Here


  protected JFreeChart createLineChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart freeChart =
      ChartFactory.createLineChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()),
        (String)evaluateExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()),
        (CategoryDataset)getDataset(),
        getPlot().getOrientation(),
        isShowLegend(),
        true,
        false);

    configureChart(freeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot();
    JRLinePlot linePlot = (JRLinePlot)getPlot();

    LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
    boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
    boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
View Full Code Here

   *
   */
  protected JFreeChart createPie3DChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createPieChart3D(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (PieDataset)getDataset(),
        isShowLegend(),
        true,
        false
        );

    configureChart(jfreeChart, getPlot());

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPie3DPlot jrPie3DPlot = (JRPie3DPlot)getPlot();
    double depthFactor = jrPie3DPlot.getDepthFactorDouble() == null ? JRPie3DPlot.DEPTH_FACTOR_DEFAULT : jrPie3DPlot.getDepthFactorDouble().doubleValue();
View Full Code Here

   *
   */
  protected JFreeChart createPieChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createPieChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (PieDataset)getDataset(),
        isShowLegend(),
        true,
        false
        );

    configureChart(jfreeChart, getPlot());
    PiePlot piePlot = (PiePlot)jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPiePlot jrPiePlot = (JRPiePlot)getPlot();
    boolean isCircular = jrPiePlot.getCircular() == null ? true : jrPiePlot.getCircular().booleanValue();
View Full Code Here


  protected JFreeChart createScatterChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createScatterPlot(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
        (String)evaluateExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression()),
        (XYDataset)getDataset(),
        getPlot().getOrientation(),
        isShowLegend(),
        true,
        false);

    configureChart(jfreeChart, getPlot());
    XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();

    JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
    boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
    boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
   
    plotRenderer.setBaseLinesVisible(isShowLines);
    plotRenderer.setBaseShapesVisible(isShowShapes);

    // Handle the axis formating for the category axis
    configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
        scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
        scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
        scatterPlot.getOwnXAxisLineColor(), false,
        (Comparable)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
        scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
        scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
        scatterPlot.getOwnYAxisLineColor(), true,
        (Comparable)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));
View Full Code Here

TOP

Related Classes of org.jfree.chart.JFreeChart

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.