Package org.jfree.chart

Examples of org.jfree.chart.JFreeChart


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

    configureChart(jfreeChart);
    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.getCategoryAxisLineColor(), 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.getValueAxisLineColor(), true,
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMaxValueExpression()));

    ((CategoryPlot)jfreeChart.getPlot()).getDomainAxis().setCategoryMargin(0);
   
    return jfreeChart;
  }
View Full Code Here


  }

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

    configureChart(jfreeChart);
    JRAreaPlot areaPlot = (JRAreaPlot)getPlot();

    // Handle the axis formating for the category axis
    configureAxis(jfreeChart.getXYPlot().getDomainAxis(), areaPlot.getCategoryAxisLabelFont(),
        areaPlot.getCategoryAxisLabelColor(), areaPlot.getCategoryAxisTickLabelFont(),
        areaPlot.getCategoryAxisTickLabelColor(), areaPlot.getCategoryAxisTickLabelMask(), areaPlot.getCategoryAxisVerticalTickLabels(),
        areaPlot.getCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(areaPlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(areaPlot.getDomainAxisMaxValueExpression()));
    // Handle the axis formating for the value axis
    configureAxis(jfreeChart.getXYPlot().getRangeAxis(), areaPlot.getValueAxisLabelFont(),
        areaPlot.getValueAxisLabelColor(), areaPlot.getValueAxisTickLabelFont(),
        areaPlot.getValueAxisTickLabelColor(), areaPlot.getValueAxisTickLabelMask(), areaPlot.getValueAxisVerticalTickLabels(),
        areaPlot.getValueAxisLineColor(), true,
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMaxValueExpression()));
View Full Code Here

    {
      isDate = false;
    }

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createXYBarChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
        isDate,
        (String)evaluateExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
        tmpDataset,
        getPlot().getOrientation(),
        isShowLegend(),
        true,
        false
        );

    configureChart(jfreeChart);

    XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
    //plot.setNoDataMessage("No data to display");
//    ((XYPlot)plot.getDomainAxis()).setTickMarksVisible(
//      ((JRFillBarPlot)getPlot()).isShowTickMarks()
//      );
//    ((CategoryAxis)plot.getDomainAxis()).setTickLabelsVisible(
View Full Code Here

  protected JFreeChart createXyLineChart() throws JRException
  {
    JRLinePlot linePlot = (JRLinePlot) getPlot();

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createXYLineChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(linePlot.getCategoryAxisLabelExpression()),
        (String)evaluateExpression(linePlot.getValueAxisLabelExpression() ),
        (XYDataset)getDataset(),
        linePlot.getOrientation(),
        isShowLegend(),
        true,
        false);

    configureChart(jfreeChart);

    // Handle the axis formating for the category axis
    configureAxis(jfreeChart.getXYPlot().getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
        linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
        linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
        linePlot.getCategoryAxisLineColor(), false,
        (Comparable)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
        (Comparable)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()));
   
    // Handle the axis formating for the value axis
    configureAxis(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
        linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
        linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
        linePlot.getValueAxisLineColor(), true,
        (Comparable)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));

    XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
    boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
    boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
    lineRenderer.setBaseShapesVisible(isShowShapes);
    lineRenderer.setBaseLinesVisible(isShowLines);
View Full Code Here

  {
    String timeAxisLabel = (String)evaluateExpression(((JRTimeSeriesPlot)getPlot()).getTimeAxisLabelExpression());
    String valueAxisLabel = (String)evaluateExpression(((JRTimeSeriesPlot)getPlot()).getValueAxisLabelExpression());

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart = ChartFactory.createTimeSeriesChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        timeAxisLabel,
        valueAxisLabel,
        (TimeSeriesCollection)getDataset(),
        isShowLegend(),
        true,
        false );

    configureChart(jfreeChart);

    XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
    JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot)getPlot();

    XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
   
    boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes().booleanValue();
View Full Code Here

  protected JFreeChart createGanttChart() throws JRException
  {
    //FIXMECHART legend/tooltip/url should come from plot?
   
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createGanttChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        (String)evaluateExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
        (String)evaluateExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
        (GanttCategoryDataset)getDataset(),
        isShowLegend(),
        true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
        false
        );

    configureChart(jfreeChart);
   
    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

        chartPlot.addInterval(convertInterval(interval));
      }
    }

    // Actually create the chart around the plot
    JFreeChart jfreeChart =
      new JFreeChart(
        (String)evaluateExpression(getChart().getTitleExpression()),
        null,
        chartPlot,
        isShowLegend()
        );
View Full Code Here

    {
      chartPlot.setSubrangeInfo(0, range.getLowerBound(), range.getUpperBound());
    }

    // Build a chart around this plot
    JFreeChart jfreeChart = new JFreeChart(chartPlot);

    // Set the generic options
    configureChart(jfreeChart);
   
    return jfreeChart;
View Full Code Here

    cap.setFillPaint(Color.DARK_GRAY);
    cap.setOutlinePaint(Color.GRAY);
    cap.setOutlineStroke(new BasicStroke(0.5f));
    dialPlot.setCap(cap);

    JFreeChart jfreeChart =
    new JFreeChart(
      (String)evaluateExpression(getChart().getTitleExpression()),
      null,
      dialPlot,
      isShowLegend()
      );
View Full Code Here

   */
  public JFreeChart createChart(ChartContext chartContext) throws JRException
  {
    setChartContext(chartContext);
   
    JFreeChart jfreeChart = null;
   
    switch(getChart().getChartType()) {
      case JRChart.CHART_TYPE_AREA:
        jfreeChart = createAreaChart();
        break;
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.