Package org.jfree.chart

Examples of org.jfree.chart.JFreeChart


  /**
   *
   */
  protected JFreeChart createCandlestickChart() throws JRException
  {
    JFreeChart jfreeChart = super.createCandlestickChart();
    XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
    CandlestickRenderer renderer = (CandlestickRenderer)xyPlot.getRenderer();
    DefaultHighLowDataset dataset = (DefaultHighLowDataset)xyPlot.getDataset();
    List seriesPaints = (List)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.SERIES_COLORS);

    for(int i = 0; i < dataset.getSeriesCount(); i++)
View Full Code Here


   *
   */
  protected JFreeChart createStackedBar3DChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createStackedBarChart3D(
        (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();

    StackedBarRenderer3D stackedBarRenderer3D =
      new StackedBarRenderer3D(
        bar3DPlot.getXOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble().doubleValue(),
View Full Code Here

   *
   */
  protected JFreeChart createStackedBarChart() throws JRException
  {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
      ChartFactory.createStackedBarChart(
        (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();
    JRBarPlot barPlot = (JRBarPlot)getPlot();
    //plot.setNoDataMessage("No data to display");
    boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
    boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
    boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
View Full Code Here

   *
   */
  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, 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()));

    ((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, getPlot());
    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.getOwnCategoryAxisLineColor(), 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.getOwnValueAxisLineColor(), true,
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMinValueExpression()),
        (Comparable)evaluateExpression(areaPlot.getRangeAxisMaxValueExpression()));
View Full Code Here

    if( getChart().getDataset().getDatasetType() == JRChartDataset.XY_DATASET ){
      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, getPlot());

    XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
    //plot.setNoDataMessage("No data to display");
//    ((XYPlot)plot.getDomainAxis()).setTickMarksVisible(
//      ((JRBarPlot)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, getPlot());

    // 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.getOwnCategoryAxisLineColor(), 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.getOwnValueAxisLineColor(), 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, getPlot());

    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, 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

          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

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.