Examples of JFreeChart


Examples of org.jfree.chart.JFreeChart

    meterplot.setUnits("");
    meterplot.setDrawBorder(false);
    meterplot.setInsets(new Insets( 2, 2, 2, 2 ));
   
    meterchart = new JFreeChart(title+" Meter",
      JFreeChart.DEFAULT_TITLE_FONT, meterplot, false);
    meterchart.setBackgroundPaint(bgColor);
    panelMeter = new ChartPanel(meterchart);
    setLayout(new BorderLayout());
    add(panelMeter, BorderLayout.CENTER);
View Full Code Here

Examples of org.jfree.chart.JFreeChart

      else
      {
        key = getName();
      }

      final JFreeChart chartFromCache = loadChartFromCache(key);
      final JFreeChart chart;
      if (chartFromCache != null)
      {
        chart = chartFromCache;
      }
      else
View Full Code Here

Examples of org.jfree.chart.JFreeChart

   * @return A chart.
   */
  private JFreeChart createChart(final int year, final int[] votes)
  {

    final JFreeChart chart = ChartFactory.createPieChart3D(
        "Programming Language of the Year " + (year), // chart title
        createSampleDataset(votes), // data
        true, // include legend
        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

View Full Code Here

Examples of org.jfree.chart.JFreeChart

      votes[1] = (int) (Math.random() * 50);
      votes[2] = (int) (Math.random() * 100);
      votes[3] = (int) (Math.random() * 50);
      votes[4] = (int) (Math.random() * 100);

      final JFreeChart chart = createChart(year.intValue(), votes);

      data[i * 5] = new Object[]{
          year, "Java", new Integer(votes[0]), chart
      };
      data[i * 5 + 1] = new Object[]{
View Full Code Here

Examples of org.jfree.chart.JFreeChart

  public JFreeChart computeCategoryChart(final CategoryDataset categoryDataset)
  {
    final PlotOrientation orientation = computePlotOrientation();

    final JFreeChart chart;
    if (isThreeD())
    {
      if (isStacked())
      {
        chart = ChartFactory.createStackedBarChart3D(computeTitle(),
            getCategoryAxisLabel(), getValueAxisLabel(),
            categoryDataset, orientation, isShowLegend(),
            false, false);
      }
      else
      {
        chart = ChartFactory.createBarChart3D(computeTitle(),
            getCategoryAxisLabel(), getValueAxisLabel(), categoryDataset,
            orientation, isShowLegend(), false, false);
      }
      chart.getCategoryPlot().setDomainAxis(new FormattedCategoryAxis3D(getCategoryAxisLabel(),
          getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale()));
    }
    else
    {
      if (isStacked())
      {
        chart = ChartFactory.createStackedBarChart(computeTitle(),
            getCategoryAxisLabel(), getValueAxisLabel(),
            categoryDataset, orientation, isShowLegend(),
            false, false);
      }
      else
      {
        chart = ChartFactory.createBarChart(computeTitle(),
            getCategoryAxisLabel(), getValueAxisLabel(), categoryDataset,
            orientation, isShowLegend(), false, false);
      }
      chart.getCategoryPlot().setDomainAxis(new FormattedCategoryAxis(getCategoryAxisLabel(),
          getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale()));
    }

    final CategoryPlot plot = (CategoryPlot) chart.getPlot();
    configureLogarithmicAxis(plot);

    return chart;
  }
View Full Code Here

Examples of org.jfree.chart.JFreeChart

   * @return A chart.
   */
  private JFreeChart createChart(final int year)
  {

    final JFreeChart chart = ChartFactory.createPieChart3D(
        "Programming Language of the Year " + year, // chart title
        createSampleDataset(), // data
        true, // include legend
        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

View Full Code Here

Examples of org.jfree.chart.JFreeChart

    chartType = null;
  }

  protected JFreeChart computeXYChart(final XYDataset xyDataset)
  {
    final JFreeChart rtn;
    if (xyDataset instanceof TimeSeriesCollection)
    {
      rtn =
          ChartFactory.createTimeSeriesChart(computeTitle(), getDomainTitle(), getRangeTitle(), xyDataset,
              isShowLegend(), false, false);
    }
    else
    {
      final PlotOrientation orientation = computePlotOrientation();
      rtn = ChartFactory.createXYLineChart(computeTitle(), getDomainTitle(), getRangeTitle(),
          xyDataset, orientation, isShowLegend(), false, false);
    }

    final String chartType = getChartType();
    if (STEP_AREA_CHART_STR.equals(chartType))
    {
      final XYItemRenderer renderer;
      if (isMarkersVisible())
      {
        renderer = new XYStepAreaRenderer(XYStepAreaRenderer.AREA_AND_SHAPES);
      }
      else
      {
        renderer = new XYStepAreaRenderer(XYStepAreaRenderer.AREA);
      }
      rtn.getXYPlot().setRenderer(renderer);
    }
    else if (STEP_CHART_STR.equals(chartType))
    {
      rtn.getXYPlot().setRenderer(new XYStepRenderer(null, null));
    }
    else if (DIFFERENCE_CHART_STR.equals(chartType))
    {
      rtn.getXYPlot().setRenderer(new XYDifferenceRenderer());
    }
    configureLogarithmicAxis(rtn.getXYPlot());
    return rtn;
  }
View Full Code Here

Examples of org.jfree.chart.JFreeChart

    }
    renderer.setBaseToolTipGenerator(toolTipGenerator);
    renderer.setURLGenerator(urlGenerator);
    plot.setRenderer(renderer);

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
  }
View Full Code Here

Examples of org.jfree.chart.JFreeChart

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
  }

  protected JFreeChart computeXYChart(final XYDataset xyDataset)
  {
    final JFreeChart chart;
    if (xyDataset instanceof TimeSeriesCollection)
    {
      if (isStacked())
      {
        final ExtTimeTableXYDataset tableXYDataset = convertToTable(xyDataset);
        chart = createTimeSeriesChart(computeTitle(), getDomainTitle(), getRangeTitle(), tableXYDataset,
            isShowLegend(), false, false, true);
      }
      else
      {
        chart = createTimeSeriesChart(computeTitle(), getDomainTitle(), getRangeTitle(), xyDataset,
            isShowLegend(), false, false, false);
      }
    }
    else
    {
      final PlotOrientation orientation = computePlotOrientation();
      if (isStacked() && xyDataset instanceof XYSeriesCollection)
      {
        final XYSeriesCollection xySeriesCollection = (XYSeriesCollection) xyDataset;
        chart = createStackedXYBarChart(computeTitle(), getDomainTitle(), false, getRangeTitle(),
            convertToTable(xySeriesCollection), orientation, isShowLegend(), false, false);
      }
      else if (isStacked() && xyDataset instanceof TableXYDataset)
      {
        final TableXYDataset dataset = (TableXYDataset) xyDataset;
        chart = createStackedXYBarChart(computeTitle(), getDomainTitle(), false, getRangeTitle(),
            dataset, orientation, isShowLegend(), false, false);
      }
      else
      {
        chart = createXYBarChart(computeTitle(), getDomainTitle(), false, getRangeTitle(),
            xyDataset, orientation, isShowLegend(), false, false);
      }
    }

    configureLogarithmicAxis(chart.getXYPlot());
    return chart;
  }
View Full Code Here

Examples of org.jfree.chart.JFreeChart

    }

    final XYPlot plot = new XYPlot(dataset, domainAxis, valueAxis, renderer);
    plot.setOrientation(orientation);

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
        plot, legend);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.