Examples of PlainSeries


Examples of org.openfaces.component.chart.PlainSeries

    public LineModel(ChartView chartView) {
        this.chartView = chartView;
    }

    public Series[] getSeries() {
        PlainSeries s0 = new PlainSeries("Product 1");
        Map<String, Integer> data0 = new HashMap<String, Integer>();
        PlainSeries s1 = new PlainSeries("Product 2");
        Map<String, Integer> data1 = new HashMap<String, Integer>();

        for (int i = 0; i < chartView.getQuarterIncome().size(); i++) {
            MonthIncome income = chartView.getQuarterIncome().get(i);

            data0.put(income.getMonth(), income.getFirstProduct());
            data1.put(income.getMonth(), income.getSecondProduct());
        }

        s0.setComparator(COMPARATOR);
        s0.setData(data0);
        s1.setComparator(COMPARATOR);
        s1.setData(data1);


        return new Series[]{s0, s1};
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    }

    private void makeData() {

        series = new Series[2];
        PlainSeries s0 = new PlainSeries();
        PlainSeries s1 = new PlainSeries();
        s0.setKey("2004");
        Map<String, Integer> data0 = new HashMap<String, Integer>();
        s1.setKey("2005");
        Map<String, Integer> data1 = new HashMap<String, Integer>();

        if (country.equals("Ukraine")) {

            data0.put("Kiev", new Random().nextInt(500000));
            data0.put("Kharkov", new Random().nextInt(500000));
            data0.put("L'vov", new Random().nextInt(500000));
            data0.put("Donetsk", new Random().nextInt(500000));
            data0.put("Dnepropetrovsk", new Random().nextInt(500000));

            data1.put("Kiev", new Random().nextInt(500000));
            data1.put("Kharkov", new Random().nextInt(500000));
            data1.put("L'vov", new Random().nextInt(500000));
            data1.put("Donetsk", new Random().nextInt(500000));
            data1.put("Dnepropetrovsk", new Random().nextInt(500000));
        } else if (country.equals("France")) {
            data0.put("Paris", new Random().nextInt(500000));
            data0.put("Lion", new Random().nextInt(500000));
            data0.put("Nice", new Random().nextInt(500000));
            data1.put("Paris", new Random().nextInt(500000));
            data1.put("Lion", new Random().nextInt(500000));
            data1.put("Nice", new Random().nextInt(500000));
        } else {
            data0.put("Rome", new Random().nextInt(500000));
            data0.put("Florence", new Random().nextInt(500000));
            data1.put("Rome", new Random().nextInt(500000));
            data1.put("Florence", new Random().nextInt(500000));
        }

        s0.setComparator(Sorter.ASCENDING);
        s0.setData(data0);
        s1.setComparator(Sorter.ASCENDING);
        s1.setData(data1);
        series[0] = s0;
        series[1] = s1;
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    }

    private void makeData() {

        series = new Series[2];
        PlainSeries s0 = new PlainSeries();
        s0.setKey("countries");
        Map<String, Long> data0 = new HashMap<String, Long>();

        data0.put("Ukraine", (long) 37541700);
        data0.put("Italy", (long) 60561200);
        data0.put("France", (long) 57600000);

        s0.setComparator(Sorter.ASCENDING);
        s0.setData(data0);

        series[0] = s0;
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    }

    public void makeData() {

        series = new Series[2];
        PlainSeries series = new PlainSeries("Seasons");
        Map<String, Integer> data = new HashMap<String, Integer>();

        Random random = new Random();
        data.put(WINTER, random.nextInt(100));
        data.put(SPRING, random.nextInt(100));
        data.put(SUMMER, random.nextInt(100));
        data.put(AUTUMN, random.nextInt(100));

        series.setComparator(new TupleComparator());
        series.setData(data);

        this.series[0] = series;
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    public BurnChartBean() {
        int forN = 5;
        series = new Series[6];
        for (int i = 0; i < series.length; i++) {
            PlainSeries ps = new PlainSeries("Employee " + i);
            ps.setData(makeData(forN));
            series[i] = ps;
        }

    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    private Series[] series;

    public void makeData() {

        series = new Series[3];
        PlainSeries s0 = new PlainSeries("Minimum");
        PlainSeries s1 = new PlainSeries("Average");
        PlainSeries s2 = new PlainSeries("Maximum");
        Map<Date, Integer> data0 = new HashMap<Date, Integer>();
        Map<Date, Integer> data1 = new HashMap<Date, Integer>();
        Map<Date, Integer> data2 = new HashMap<Date, Integer>();

        Random random = new Random();
        for (int i = 0; i < 6; i++) {
            Calendar c = Calendar.getInstance(new Locale("en"));
            c.set(2005, i * 2 - 1, 1);
            Date key = c.getTime();

            data0.put(key, random.nextInt(60) - 30);
            data1.put(key, random.nextInt(60) - 30);
            data2.put(key, random.nextInt(60) - 30);
        }


        s0.setComparator(Sorter.ASCENDING);
        s0.setData(data0);

        s1.setComparator(Sorter.ASCENDING);
        s1.setData(data1);

        s2.setComparator(Sorter.ASCENDING);
        s2.setData(data2);

        series[0] = s0;
        series[1] = s1;
        series[2] = s2;

View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    }

    public void makeData() {

        series = new Series[2];
        PlainSeries series = new PlainSeries("Seasons");
        Map<String, Integer> data = new HashMap<String, Integer>();

        Random random = new Random();
        data.put(WINTER, random.nextInt(40));
        data.put(SPRING, random.nextInt(40));
        data.put(SUMMER, random.nextInt(40));
        data.put(AUTUMN, random.nextInt(40));

        series.setComparator(new TupleComparator());
        series.setData(data);

        this.series[0] = series;

    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

        this.country = country;
    }

    public void makeData() {
        series = new Series[1];
        PlainSeries s0 = new PlainSeries(country);
        Map<GregorianCalendar, Integer> data0 = new HashMap<GregorianCalendar, Integer>();
        for (int i = 0; i < 12; i++) {
            data0.put(new GregorianCalendar(2004, i, 1), new Random().nextInt(10));
        }
        s0.setComparator(Sorter.ASCENDING);
        s0.setData(data0);
        series[0] = s0;
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

        data.put("Berlin, Germany", (long) 3396990);
        data.put("Madrid, Spain", (long) 3155359);
        data.put("Rome, Italy", (long) 2542003);
        data.put("Paris, France", (long) 2142800);

        PlainSeries series = new PlainSeries();
        series.setData(data);
        series.setKey("Largest cities of the European Union");

        PlainModel model = new PlainModel();
        model.addSeries(series);
        return model;
    }
View Full Code Here

Examples of org.openfaces.component.chart.PlainSeries

    private Series[] series;

    public void makeData() {
        series = new Series[2];
        PlainSeries s0 = new PlainSeries("2005");
        PlainSeries s1 = new PlainSeries("2006");
        Map<String, Integer> data0 = new HashMap<String, Integer>();
        Map<String, Integer> data1 = new HashMap<String, Integer>();


        Random random = new Random();
        data0.put(JANUARY, random.nextInt(50));
        data0.put(APRIL, random.nextInt(50));
        data0.put(JULY, random.nextInt(50));
        data0.put(OCTOBER, random.nextInt(50));

        data1.put(JANUARY, random.nextInt(50));
        data1.put(APRIL, random.nextInt(50));
        data1.put(JULY, random.nextInt(50));
        data1.put(OCTOBER, random.nextInt(50));

        s0.setComparator(COMPARATOR);
        s0.setData(data0);

        s1.setComparator(COMPARATOR);
        s1.setData(data1);

        series[0] = s0;
        series[1] = s1;

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.