Package com.invient.vaadin.charts

Examples of com.invient.vaadin.charts.InvientCharts$SeriesLegendItemClickEvent


        .setFormatterJsFunc(
            "function() { "
                + " return '<b>' + this.series.name + '</b><br/>' +  this.x + ': '+ this.y +' U'"
                + "}");

    chart = new InvientCharts(chartConfig);

    add2008(chart);
    add2009(chart);
    add2010(chart);
    add2011(chart);
View Full Code Here


        }
    }

    private void showMasterDetail() {
        // Create the master chart
        final InvientCharts masterChart = getMasterChart();
        // Create detail chart
        final InvientCharts detailChart = getDetailChart(masterChart);
        // Register events
        masterChart.addListener(new ChartZoomListener() {

            @Override
            public void chartZoom(ChartZoomEvent chartZoomEvent) {
                // chartZoomEvent.getChartArea().get
                DateTimeSeries masterChartSeries = (DateTimeSeries) masterChart
                        .getSeries("USD to EUR");
                double min = chartZoomEvent.getChartArea().getxAxisMin();
                double max = chartZoomEvent.getChartArea().getxAxisMax();
                LinkedHashSet<DateTimePoint> detailPoints = new LinkedHashSet<InvientCharts.DateTimePoint>();
                DateTimeSeries detailChartSeries = (DateTimeSeries) detailChart
                        .getSeries("USD to EUR");
                detailChart.removeSeries(detailChartSeries);

                for (DateTimePoint point : masterChartSeries.getPoints()) {
                    if (point.getX().getTime() > min
                            && point.getX().getTime() < max) {
                        detailPoints.add(new DateTimePoint(detailChartSeries,
                                point.getX(), point.getY()));
                    }
                }
                // Update series with new points
                detailChartSeries.setSeriesPoints(detailPoints);
                detailChart.addSeries(detailChartSeries);
                detailChart.refresh();
                // Update plotbands
                DateTimeAxis masterDateTimeAxis = (DateTimeAxis) masterChart
                        .getConfig().getXAxes().iterator().next();
                masterDateTimeAxis.removePlotBand("mask-before");
                DateTimePlotBand plotBandBefore = new DateTimePlotBand(
View Full Code Here

        marker.setHoverState(new MarkerState());
        marker.getHoverState().setEnabled(true);
        marker.getHoverState().setRadius(3);
        detailChartConfig.addSeriesConfig(lineCfg);

        InvientCharts detailChart = new InvientCharts(detailChartConfig);

        // Line instance configuration
        LineConfig lineSeriesCfg = new LineConfig();
        lineSeriesCfg.setPointStart((double) detailChartPointStartDate
                .getTime());
        lineSeriesCfg.setPointInterval(24 * 3600 * 1000.0);
        lineSeriesCfg.setColor(new RGB(69, 114, 167));
        DateTimeSeries detailSeries = new DateTimeSeries("USD to EUR",
                SeriesType.LINE, lineSeriesCfg);

        LinkedHashSet<DateTimePoint> detailPoints = new LinkedHashSet<InvientCharts.DateTimePoint>();
        DateTimeSeries masterChartSeries = (DateTimeSeries) masterChart
                .getSeries("USD to EUR");
        for (DateTimePoint point : masterChartSeries.getPoints()) {
            if (point.getX().getTime() >= detailChartPointStartDate.getTime()) {
                detailPoints.add(new DateTimePoint(detailSeries, point.getY()));
            }
        }

        detailSeries.setSeriesPoints(detailPoints);
        detailChart.addSeries(detailSeries);

        return detailChart;
    }
View Full Code Here

        areaCfg.setEnableMouseTracking(false);
        areaCfg.setHoverState(new SeriesState());
        areaCfg.getHoverState().setLineWidth(1);
        chartConfig.addSeriesConfig(areaCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        // Provide methods to set pointInterval and pointStart and delegate call
        // to SeriesConfig
        AreaConfig seriesDataCfg = new AreaConfig();
        seriesDataCfg.setPointInterval(24 * 3600 * 1000.0);
        seriesDataCfg.setPointStart((double) masterChartMinDate.getTime());
        DateTimeSeries masterChartSeries = new DateTimeSeries("USD to EUR",
                SeriesType.AREA, seriesDataCfg);
        masterChartSeries
                .setSeriesPoints(getMasterDetailData(masterChartSeries));
        chart.addSeries(masterChartSeries);

        return chart;
    }
View Full Code Here

                .setFormatterJsFunc(
                        "function() { "
                                + " 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

        ScatterConfig scatterCfg = new ScatterConfig();
        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(),
View Full Code Here

        lineCfg.setDataLabel(new DataLabel());
        lineCfg.getDataLabel().setEnabled(true);
        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

        SeriesConfig seriesCfg = new SeriesConfig();
        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

        legend.setShadow(true);
        chartConfig.setLegend(legend);

        chartConfig.getCredit().setEnabled(false);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("Year 1800");
        seriesData.setSeriesPoints(getPoints(seriesData, 107, 31, 635, 203, 2));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Year 1900");
        seriesData
                .setSeriesPoints(getPoints(seriesData, 133, 156, 947, 408, 6));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Year 2008");
        seriesData.setSeriesPoints(getPoints(seriesData, 973, 914, 4054, 732,
                34));
        chart.addSeries(seriesData);

        addChart(chart);

    }
View Full Code Here

        SeriesConfig series = new SeriesConfig();
        series.setStacking(Stacking.NORMAL);
        chartConfig.addSeriesConfig(series);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries seriesData = new XYSeries("Male");
        seriesData.setSeriesPoints(getPoints(seriesData, -1746181, -1884428,
                -2089758, -2222362, -2537431, -2507081, -2443179, -2664537,
                -3556505, -3680231, -3143062, -2721122, -2229181, -2227768,
                -2176300, -1329968, -836804, -354784, -90569, -28367, -3878));
        chart.addSeries(seriesData);

        seriesData = new XYSeries("Female");
        seriesData.setSeriesPoints(getPoints(seriesData, 1656154, 1787564,
                1981671, 2108575, 2403438, 2366003, 2301402, 2519874, 3360596,
                3493473, 3050775, 2759560, 2304444, 2426504, 2568938, 1785638,
                1447162, 1005011, 330870, 130632, 21208));
        chart.addSeries(seriesData);

        addChart(chart);
    }
View Full Code Here

TOP

Related Classes of com.invient.vaadin.charts.InvientCharts$SeriesLegendItemClickEvent

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.