Package org.jfree.data.category

Examples of org.jfree.data.category.DefaultCategoryDataset


        String s3 = "Gennaio";
        String s4 = "Febbraio";
        String s5 = "Marzo";
        String s6 = "Aprile";
        DefaultCategoryDataset defaultcategorydataset = new DefaultCategoryDataset();

        /* blue */
        defaultcategorydataset.addValue(1.0D, s, s3);
        defaultcategorydataset.addValue(4D, s, s4);
        defaultcategorydataset.addValue(3D, s, s5);
        defaultcategorydataset.addValue(5D, s, s6);
        // defaultcategorydataset.addValue(5D, s, s7);

        /* verde */
        defaultcategorydataset.addValue(5D, s1, s3);
        defaultcategorydataset.addValue(7D, s1, s4);
        defaultcategorydataset.addValue(6D, s1, s5);
        defaultcategorydataset.addValue(8D, s1, s6);
        // defaultcategorydataset.addValue(4D, s1, s7);

        /* rosa */
        defaultcategorydataset.addValue(4D, s2, s3);
        defaultcategorydataset.addValue(3D, s2, s4);
        defaultcategorydataset.addValue(2D, s2, s5);
        defaultcategorydataset.addValue(3D, s2, s6);
        // defaultcategorydataset.addValue(6D, s2, s7);

        SpiderWebPlot spiderwebplot = new SpiderWebPlot(defaultcategorydataset);
        spiderwebplot.setInteriorGap(0.40000000000000002D);
        return spiderwebplot;
View Full Code Here


  }

  private CategoryDataset createDataSet(Double[] tutar, String barIsmi,
      String[] kategori) {

    dataset = new DefaultCategoryDataset();
    for (int i = 0; i < kategori.length; i++) {
      if (kategori[i] == null) {
        break;
      }
      dataset.addValue(tutar[i], barIsmi, kategori[i]);
View Full Code Here

    image = relativeChart.createBufferedImage(NODE_WIDTH,NODE_HEIGHT);
    relativeLabel = new JLabel();
    relativeLabel.setIcon(new ImageIcon(image));

    /* Create chart with power of all nodes */
    totalDataset = new DefaultCategoryDataset();
    for (int i=0; i < NUMBER_NODES; i++) {
      for (String category: CATEGORIES) {
        totalDataset.addValue(0, category, getNodeNameFromIndex(i));
      }
    }
View Full Code Here

public class jfrechart
{
  public static void main(String s[])
  {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(6, "Profit1", "Jane");
    dataset.setValue(3, "Profit2", "Jane");
    dataset.setValue(7, "Profit1", "Tom");
    dataset.setValue(10, "Profit2", "Tom");
    dataset.setValue(8, "Profit1", "Jill");
    dataset.setValue(8, "Profit2", "Jill");
    dataset.setValue(5, "Profit1", "John");
    dataset.setValue(6, "Profit2", "John");
    dataset.setValue(12, "Profit1", "Fred");
    dataset.setValue(5, "Profit2", "Fred");

    // Profit1, Profit2 represent the row keys
    // Jane, Tom, Jill, etc. represent the column keys

    JFreeChart chart = ChartFactory.createBarChart3D(
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), key + " " + amount, key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createBarChart(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), key + " " + amount, key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createBarChart3D(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), key + " " + amount, key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createStackedBarChart(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), key + " " + amount, key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createStackedBarChart3D(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), "2009", key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createLineChart(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

    // get a list of data
    List<ChartData> kunAmountList = getChartService().getChartDataForCustomer(kunId);

    if (kunAmountList.size() > 0) {

      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      for (ChartData chartData : kunAmountList) {

        Calendar calendar = new GregorianCalendar();
        calendar.setTime(chartData.getChartKunInvoiceDate());

        int month = calendar.get(Calendar.MONTH) + 1;
        int year = calendar.get(Calendar.YEAR);
        String key = String.valueOf(month) + "/" + String.valueOf(year);

        BigDecimal bd = chartData.getChartKunInvoiceAmount().setScale(15, 3);
        String amount = String.valueOf(bd.doubleValue());

        // fill the data
        dataset.setValue(new Double(chartData.getChartKunInvoiceAmount().doubleValue()), "2009", key + " " + amount);
      }

      String title = "Monthly amount for year 2009";
      PlotOrientation po = PlotOrientation.VERTICAL;
      JFreeChart chart = ChartFactory.createLineChart3D(title, "Month", "Amount", dataset, po, true, true, true);
View Full Code Here

TOP

Related Classes of org.jfree.data.category.DefaultCategoryDataset

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.