Package com.invient.vaadin.charts.InvientCharts

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


        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


    }
  }

  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

    }
  }

  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);
View Full Code Here

    }
  }

  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

    }
  }

  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);
View Full Code Here

  private static LinkedHashSet<DecimalPoint> getPoints(final Series series,
      final double... values) {
    LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
    for (double value : values) {
      points.add(new DecimalPoint(series, value));
    }
    return points;
  }
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

        XYSeries series = new XYSeries("Tokyo", splineCfg);
        series.setSeriesPoints(getPoints(series, 7.0, 6.9, 9.5, 14.5, 18.2,
                21.5, 25.2));
        PointConfig config = new PointConfig(new ImageMarker(
                "/graphics/sun.png"));
        DecimalPoint highest = new DecimalPoint(series, 26.5, config);
        series.addPoint(highest);
        series.addPoint(new DecimalPoint(series, 23.3));
        series.addPoint(new DecimalPoint(series, 18.3));
        series.addPoint(new DecimalPoint(series, 13.9));
        series.addPoint(new DecimalPoint(series, 9.6));
        chart.addSeries(series);

        // Series
        splineCfg = new SplineConfig();
        splineCfg.setMarker(new SymbolMarker(Symbol.DIAMOND));
        series = new XYSeries("London", splineCfg);
        config = new PointConfig(new ImageMarker("/graphics/snow.png"));
        DecimalPoint lowest = new DecimalPoint(series, 3.9, config);
        series.addPoint(lowest);
        series.addPoint(new DecimalPoint(series, 4.2));
        series.addPoint(new DecimalPoint(series, 5.7));
        series.addPoint(new DecimalPoint(series, 8.5));
        series.addPoint(new DecimalPoint(series, 11.9));
        series.addPoint(new DecimalPoint(series, 15.2));
        series.addPoint(new DecimalPoint(series, 17.0));
        series.addPoint(new DecimalPoint(series, 16.6));
        series.addPoint(new DecimalPoint(series, 14.2));
        series.addPoint(new DecimalPoint(series, 10.3));
        series.addPoint(new DecimalPoint(series, 6.6));
        series.addPoint(new DecimalPoint(series, 4.8));
        chart.addSeries(series);

        addChart(chart);

    }
View Full Code Here

        pieCfg.getDataLabel().setEnabled(false);

        XYSeries totalConsumpSeriesData = new XYSeries("Total consumption",
                SeriesType.PIE, pieCfg);
        PointConfig config = new PointConfig(new RGB(69, 114, 167));
        DecimalPoint point = new DecimalPoint(totalConsumpSeriesData, "Jane",
                13, config);
        totalConsumpSeriesData.addPoint(point);
        config = new PointConfig(new RGB(170, 70, 67));
        point = new DecimalPoint(totalConsumpSeriesData, "John", 23, config);
        totalConsumpSeriesData.addPoint(point);
        config = new PointConfig(new RGB(137, 165, 78));
        point = new DecimalPoint(totalConsumpSeriesData, "Joe", 19, config);
        totalConsumpSeriesData.addPoint(point);

        ChartLabel chartLabel = new ChartLabel();
        chartLabel.addLabel(new ChartLabelItem("Total fruit consumption",
                "{ left: '40px', top: '8px', color: 'black' }"));
View Full Code Here

    private static LinkedHashSet<DecimalPoint> getPoints(Series series,
            double... values) {
        LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
        for (double value : values) {
            points.add(new DecimalPoint(series, value));
        }
        return points;
    }
View Full Code Here

TOP

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

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.