Package com.invient.vaadin.charts.InvientCharts

Examples of com.invient.vaadin.charts.InvientCharts.XYSeries


      for (Entry<Integer, DecimalPoint> decimalPoint : map.entrySet()) {
        quantity++;
        sum += decimalPoint.getValue().getY();
      }
      Double result = sum / quantity;
      XYSeries seriesData = new XYSeries(key + " (średnia = " + format.format(result) + ")");
      for (Entry<Integer, DecimalPoint> decimalPoint : map.entrySet()) {
        seriesData.addPoint(new DecimalPoint(seriesData, decimalPoint.getKey(),
            decimalPoint.getValue().getY()));
      }
      chart.addSeries(seriesData);
    }
  }
View Full Code Here


      public void buttonClick(final ClickEvent event) {
        double parseDouble = Double.parseDouble(textField.getValue().toString());
        Date date = (Date) dateField.getValue();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        DecimalPoint p = new DecimalPoint(new XYSeries("2008"), Double.parseDouble(date
            .getMonth() + ""), parseDouble);
        int year = calendar.get(Calendar.YEAR);
        Map<Integer, DecimalPoint> map = main.points.get(year);
        if (map == null) {
          main.points.put(year, new LinkedHashMap<Integer, DecimalPoint>());
View Full Code Here

      chart.addSeries(seriesData);
    }
  }

  private void add2008(final InvientCharts chart) {
    XYSeries seriesData = new XYSeries("2008");
    seriesData.addPoint(new DecimalPoint(seriesData, 0, 153.13));
    seriesData.addPoint(new DecimalPoint(seriesData, 1, 195.23));
    seriesData.addPoint(new DecimalPoint(seriesData, 2, 102.62));
    seriesData.addPoint(new DecimalPoint(seriesData, 3, 102.15));
    seriesData.addPoint(new DecimalPoint(seriesData, 4, 70.74));
    seriesData.addPoint(new DecimalPoint(seriesData, 5, 145.47));
    seriesData.addPoint(new DecimalPoint(seriesData, 6, 127.92));
    seriesData.addPoint(new DecimalPoint(seriesData, 7, 87.08));
    seriesData.addPoint(new DecimalPoint(seriesData, 8, 101.99));
    seriesData.addPoint(new DecimalPoint(seriesData, 9, 123.28));
    seriesData.addPoint(new DecimalPoint(seriesData, 10, 89.85));
    seriesData.addPoint(new DecimalPoint(seriesData, 11, 145.01));
    int quantity = 0;
    points.put(2008, new LinkedHashMap<Integer, DecimalPoint>());
    for (DecimalPoint decimalPoint : seriesData.getPoints()) {
      points.get(2008).put(quantity, decimalPoint);
      quantity++;
    }
  }
View Full Code Here

      quantity++;
    }
  }

  private void add2009(final InvientCharts chart) {
    XYSeries seriesData = new XYSeries("2009");
    seriesData.addPoint(new DecimalPoint(seriesData, 0, 128.74));
    seriesData.addPoint(new DecimalPoint(seriesData, 1, 152.73));
    seriesData.addPoint(new DecimalPoint(seriesData, 2, 78.31));
    seriesData.addPoint(new DecimalPoint(seriesData, 3, 77.18));
    seriesData.addPoint(new DecimalPoint(seriesData, 4, 79.87));
    seriesData.addPoint(new DecimalPoint(seriesData, 5, 85.6));
    seriesData.addPoint(new DecimalPoint(seriesData, 6, 147.74));
    seriesData.addPoint(new DecimalPoint(seriesData, 7, 82.74));
    seriesData.addPoint(new DecimalPoint(seriesData, 8, 110.16));
    seriesData.addPoint(new DecimalPoint(seriesData, 9, 68.84));
    seriesData.addPoint(new DecimalPoint(seriesData, 10, 113.38));
    seriesData.addPoint(new DecimalPoint(seriesData, 11, 125.15));

    int quantity = 0;
    points.put(2009, new LinkedHashMap<Integer, DecimalPoint>());
    for (DecimalPoint decimalPoint : seriesData.getPoints()) {
      points.get(2009).put(quantity, decimalPoint);
      quantity++;
    }
  }
View Full Code Here

      quantity++;
    }
  }

  private void add2010(final InvientCharts chart) {
    XYSeries seriesData = new XYSeries("2010");
    seriesData.addPoint(new DecimalPoint(seriesData, 0, 135.14));
    seriesData.addPoint(new DecimalPoint(seriesData, 1, 139.89));
    seriesData.addPoint(new DecimalPoint(seriesData, 2, 95.3));
    seriesData.addPoint(new DecimalPoint(seriesData, 3, 100.73));
    seriesData.addPoint(new DecimalPoint(seriesData, 4, 65.45));
    seriesData.addPoint(new DecimalPoint(seriesData, 5, 108.8));
    seriesData.addPoint(new DecimalPoint(seriesData, 6, 136.7));
    seriesData.addPoint(new DecimalPoint(seriesData, 7, 116.23));
    seriesData.addPoint(new DecimalPoint(seriesData, 8, 86.58));
    seriesData.addPoint(new DecimalPoint(seriesData, 9, 135.5));
    seriesData.addPoint(new DecimalPoint(seriesData, 10, 124.43));
    seriesData.addPoint(new DecimalPoint(seriesData, 11, 173.33));
    int quantity = 0;
    points.put(2010, new LinkedHashMap<Integer, DecimalPoint>());
    for (DecimalPoint decimalPoint : seriesData.getPoints()) {
      points.get(2010).put(quantity, decimalPoint);
      quantity++;
    }
  }
View Full Code Here

      quantity++;
    }
  }

  private void add2011(final InvientCharts chart) {
    XYSeries seriesData = new XYSeries("2011");
    seriesData.addPoint(new DecimalPoint(seriesData, 0, 246.64));
    seriesData.addPoint(new DecimalPoint(seriesData, 1, 127.54));
    seriesData.addPoint(new DecimalPoint(seriesData, 2, 110.07));
    seriesData.addPoint(new DecimalPoint(seriesData, 3, 94.34));
    seriesData.addPoint(new DecimalPoint(seriesData, 4, 94.56));
    seriesData.addPoint(new DecimalPoint(seriesData, 5, 173.29));
    seriesData.addPoint(new DecimalPoint(seriesData, 6, 151.85));
    seriesData.addPoint(new DecimalPoint(seriesData, 7, 106.48));
    seriesData.addPoint(new DecimalPoint(seriesData, 8, 145.24));
    seriesData.addPoint(new DecimalPoint(seriesData, 9, 111.31));
    seriesData.addPoint(new DecimalPoint(seriesData, 10, 122.77));
    seriesData.addPoint(new DecimalPoint(seriesData, 11, 100.00));

    int quantity = 0;
    points.put(2011, new LinkedHashMap<Integer, DecimalPoint>());
    for (DecimalPoint decimalPoint : seriesData.getPoints()) {
      points.get(2011).put(quantity, decimalPoint);
      quantity++;
    }
  }
View Full Code Here

                                + " return '<b>' + this.series.name + '</b><br/>' +  this.x + ': '+ this.y +'°C'"
                                + "}");

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("Tokyo");
        seriesData.setSeriesPoints(getPoints(seriesData, 7.0, 6.9, 9.5, 14.5,
                18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("New York");
        seriesData.setSeriesPoints(getPoints(seriesData, -0.2, 0.8, 5.7, 11.3,
                17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Berlin");
        seriesData.setSeriesPoints(getPoints(seriesData, -0.9, 0.6, 3.5, 8.4,
                13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("London");
        seriesData.setSeriesPoints(getPoints(seriesData, 3.9, 4.2, 5.7, 8.5,
                11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8));
        chart.addSeries(seriesData);

        addChart(chart);
    }
View Full Code Here

        scatterCfg.setLineWidth(1);
        chartConfig.addSeriesConfig(scatterCfg);
        // chart data
        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("User Supplied Data");
        seriesData.addPoint(new DecimalPoint(seriesData, 20, 20));
        seriesData.addPoint(new DecimalPoint(seriesData, 80, 80));
        chart.addSeries(seriesData);

        chart.addListener(new ChartClickListener() {

            @Override
            public void chartClick(ChartClickEvent chartClickEvent) {
                logEventInfo("chartClick",
                        ((DecimalPoint) chartClickEvent.getPoint()).getX(),
                        ((DecimalPoint) chartClickEvent.getPoint()).getY(),
                        chartClickEvent.getMousePosition().getMouseX(),
                        chartClickEvent.getMousePosition().getMouseY());
                XYSeries xySeries = (XYSeries) chartClickEvent.getChart()
                        .getSeries("User Supplied Data");
                xySeries.addPoint(new DecimalPoint(xySeries,
                        ((DecimalPoint) chartClickEvent.getPoint()).getX(),
                        ((DecimalPoint) chartClickEvent.getPoint()).getY()));
            }
        });

        chart.addListener(new PointClickListener() {

            @Override
            public void pointClick(PointClickEvent pointClickEvent) {
                logEventInfo("pointClick", pointClickEvent.getPoint()
                        .getSeries().getName(), pointClickEvent.getCategory(),
                        (Double) pointClickEvent.getPoint().getX(),
                        (Double) pointClickEvent.getPoint().getY(),
                        pointClickEvent.getMousePosition().getMouseX(),
                        pointClickEvent.getMousePosition().getMouseY());
                XYSeries xySeries = (XYSeries) pointClickEvent.getChart()
                        .getSeries("User Supplied Data");
                if (xySeries.getPoints().size() > 1) {
                    // remove the clicked point
                    xySeries.removePoint((DecimalPoint) pointClickEvent
                            .getPoint());
                }
            }
        });
View Full Code Here

        lineCfg.setEnableMouseTracking(false);
        chartConfig.addSeriesConfig(lineCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("Tokyo");
        seriesData.setSeriesPoints(getPoints(seriesData, 7.0, 6.9, 9.5, 14.5,
                18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("London");
        seriesData.setSeriesPoints(getPoints(seriesData, 3.9, 4.2, 5.7, 8.5,
                11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8));
        chart.addSeries(seriesData);

        addChart(chart);
    }
View Full Code Here

        seriesCfg.setStacking(Stacking.NORMAL);
        chartConfig.addSeriesConfig(seriesCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("John");
        seriesData.setSeriesPoints(getPoints(seriesData, 5, 3, 4, 7, 2));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Jane");
        seriesData.setSeriesPoints(getPoints(seriesData, 2, 2, 3, 2, 1));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Joe");
        seriesData.setSeriesPoints(getPoints(seriesData, 3, 4, 4, 2, 5));
        chart.addSeries(seriesData);

        addChart(chart);

    }
View Full Code Here

TOP

Related Classes of com.invient.vaadin.charts.InvientCharts.XYSeries

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.