Package com.invient.vaadin.charts

Examples of com.invient.vaadin.charts.InvientChartsConfig$State


        addChart(chart);
    }

    private void showAreaPercent() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.AREA);

        chartConfig
                .getTitle()
                .setText(
                        "Historic and Estimated Worldwide Population Distribution by Region");
        chartConfig.getSubtitle().setText("Source: Wikipedia.org");

        CategoryAxis xAxis = new CategoryAxis();
        xAxis.setCategories(Arrays.asList("1750", "1800", "1850", "1900",
                "1950", "1999", "2050"));
        Tick tick = new Tick();
        tick.setPlacement(TickmarkPlacement.ON);
        xAxis.setTick(tick);
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Percent"));
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        chartConfig
                .getTooltip()
                .setFormatterJsFunc(
                        "function() {"
                                + " return '' + this.x +': ' + $wnd.Highcharts.numberFormat(this.percentage, 1) + "
                                + "    '% ('+ $wnd.Highcharts.numberFormat(this.y, 0, ',') +' millions)'; "
                                + "}");

        AreaConfig areaCfg = new AreaConfig();
        areaCfg.setStacking(Stacking.PERCENT);
        areaCfg.setLineColor(new RGB(255, 255, 255));
        areaCfg.setLineWidth(1);

        SymbolMarker marker = new SymbolMarker();
        marker.setLineColor(new RGB(255, 255, 255));
        marker.setLineWidth(1);
        areaCfg.setMarker(marker);

        chartConfig.addSeriesConfig(areaCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("Asia");
        series.setSeriesPoints(getPoints(series, 502, 635, 809, 947, 1402,
View Full Code Here


        addChart(chart);
    }

    private void showAreaBasic() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.AREA);

        chartConfig.getTitle().setText("US and USSR nuclear stockpiles");
        //
        chartConfig
                .getSubtitle()
                .setText(
                        "Source: <a href='http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf'>thebulletin.metapress.com</a>");

        NumberXAxis xAxis = new NumberXAxis();
        xAxis.setLabel(new XAxisDataLabel());
        xAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value;" + "}");

        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Nuclear weapon states"));
        yAxis.setLabel(new YAxisDataLabel());
        yAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value / 1000 +'k';" + "}");

        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        chartConfig
                .getTooltip()
                .setFormatterJsFunc(
                        "function() {"
                                + " return this.series.name +' produced <b>'+"
                                + "    $wnd.Highcharts.numberFormat(this.y, 0) +'</b><br/>warheads in '+ this.x;"
                                + "}");

        AreaConfig areaCfg = new AreaConfig();
        areaCfg.setPointStart(1940.0);
        SymbolMarker marker = new SymbolMarker();
        areaCfg.setMarker(marker);
        marker.setEnabled(false);
        marker.setSymbol(Symbol.CIRCLE);
        marker.setRadius(2);
        marker.setHoverState(new MarkerState(true));
        chartConfig.addSeriesConfig(areaCfg);
        InvientCharts chart = new InvientCharts(chartConfig);

        // Series -
        AreaConfig usaAreaCfg = new AreaConfig();
        usaAreaCfg.setPointStart(1940.0);
View Full Code Here

            points.add(new DecimalPoint(series));
        }
    }

    private void showAreaSpline() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.AREASPLINE);

        chartConfig.getTitle().setText(
                "Average fruit consumption during one week");

        Legend legend = new Legend();
        legend.setLayout(Layout.VERTICAL);
        Position legendPos = new Position();
        legendPos.setAlign(HorzAlign.LEFT);
        legendPos.setVertAlign(VertAlign.TOP);
        legendPos.setX(150);
        legendPos.setY(100);
        legend.setPosition(legendPos);
        legend.setFloating(true);
        legend.setBorderWidth(1);
        legend.setBackgroundColor(new RGB(255, 255, 255));
        chartConfig.setLegend(legend);

        CategoryAxis xAxis = new CategoryAxis();
        xAxis.setCategories(Arrays.asList("Monday", "Tuesday", "Wednesday",
                "Thursday", "Friday", "Saturday", "Sunday"));
        NumberPlotBand plotBand = new NumberPlotBand("sat-sun");
        plotBand.setRange(new NumberRange(4.6, 6.5));
        plotBand.setColor(new RGBA(68, 170, 213, 0.2f));
        xAxis.addPlotBand(plotBand);

        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Fruit units"));

        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        chartConfig.getCredit().setEnabled(false);

        AreaSplineConfig areaSpline = new AreaSplineConfig();
        areaSpline.setFillOpacity(0.5);
        chartConfig.addSeriesConfig(areaSpline);
        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("John");
        series.setSeriesPoints(getPoints(series, 3, 4, 3, 5, 4, 10, 12));
        chart.addSeries(series);
View Full Code Here

        addChart(chart);
    }

    private void showPieWithLegend() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.PIE);

        chartConfig.getTitle().setText(
                "Browser market shares at a specific website, 2010");

        chartConfig
                .getTooltip()
                .setFormatterJsFunc(
                        "function() {"
                                + " return '<b>'+ this.point.name +'</b>: '+ this.y +' %'; "
                                + "}");

        PieConfig pie = new PieConfig();
        pie.setAllowPointSelect(true);
        pie.setCursor("pointer");
        pie.setDataLabel(new PieDataLabel(false));
        pie.setShowInLegend(true);
        chartConfig.addSeriesConfig(pie);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("Browser Share");
        LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
View Full Code Here

        addChart(chart);
    }

    //
    private void showDonut() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.PIE);

        chartConfig.getGeneralChartConfig().setMargin(new Margin());
        chartConfig.getGeneralChartConfig().getMargin().setTop(50);
        chartConfig.getGeneralChartConfig().getMargin().setRight(0);
        chartConfig.getGeneralChartConfig().getMargin().setBottom(0);
        chartConfig.getGeneralChartConfig().getMargin().setLeft(0);

        chartConfig.getTitle().setText(
                "Browser market shares at a specific website");
        chartConfig.getSubtitle().setText(
                "Inner circle: 2008, outer circle: 2010");

        chartConfig.getTooltip().setFormatterJsFunc(
                "function() {"
                        + " return '<b>'+ this.series.name +'</b><br/>'+ "
                        + "     this.point.name +': '+ this.y +' %'; " + "}");

        InvientCharts chart = new InvientCharts(chartConfig);
View Full Code Here

        point.setConfig(new PointConfig(color));
        return point;
    }

    private void showPie() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.PIE);
        chartConfig.getTitle().setText(
                "Browser market shares at a specific website, 2010");

        PieConfig pieCfg = new PieConfig();
        pieCfg.setAllowPointSelect(true);
        pieCfg.setCursor("pointer");
        pieCfg.setDataLabel(new PieDataLabel());
        pieCfg.getDataLabel().setEnabled(true);
        pieCfg.getDataLabel()
                .setFormatterJsFunc(
                        "function() {"
                                + " return '<b>'+ this.point.name +'</b>: '+ this.y +' %';"
                                + "}");
        pieCfg.getDataLabel().setConnectorColor(new RGB(0, 0, 0));

        chartConfig.addSeriesConfig(pieCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("Browser Share");
        LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
View Full Code Here

        addChart(chart);
    }

    private void showScatter() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.SCATTER);
        chartConfig.getGeneralChartConfig().setZoomType(ZoomType.XY);

        chartConfig.getTitle().setText(
                "Height Versus Weight of Individuals by Gender");
        chartConfig.getSubtitle().setText("Source: Heinz  2003");

        chartConfig.getTooltip().setFormatterJsFunc(
                "function() {"
                        + " return '' + this.x + ' cm, ' + this.y + ' kg'; "
                        + "}");

        NumberXAxis xAxis = new NumberXAxis();
        xAxis.setTitle(new AxisTitle("Height (cm)"));
        xAxis.setStartOnTick(true);
        xAxis.setEndOnTick(true);
        xAxis.setShowLastLabel(true);
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Weight (kg)"));
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        Legend legend = new Legend();
        legend.setLayout(Layout.VERTICAL);
        Position legendPos = new Position();
        legendPos.setAlign(HorzAlign.LEFT);
        legendPos.setVertAlign(VertAlign.TOP);
        legendPos.setX(100);
        legendPos.setY(70);
        legend.setPosition(legendPos);
        legend.setFloating(true);
        legend.setBorderWidth(1);
        legend.setBackgroundColor(new RGB(255, 255, 255));
        chartConfig.setLegend(legend);

        ScatterConfig scatterCfg = new ScatterConfig();

        SymbolMarker marker = new SymbolMarker(5);
        scatterCfg.setMarker(marker);
        marker.setHoverState(new MarkerState());
        marker.getHoverState().setEnabled(true);
        marker.getHoverState().setLineColor(new RGB(100, 100, 100));
        chartConfig.addSeriesConfig(scatterCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        ScatterConfig femaleScatterCfg = new ScatterConfig();
        femaleScatterCfg.setColor(new RGBA(223, 83, 83, 0.5f));
View Full Code Here

        chart.addSeries(series);
        addChart(chart);
    }

    private void showCombinationScatterWithRegressionLine() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();

        chartConfig.getTitle().setText("Scatter plot with regression line");

        NumberXAxis xAxis = new NumberXAxis();
        xAxis.setMin(-0.5);
        xAxis.setMax(5.5);
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setMin(0.0);
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        InvientCharts chart = new InvientCharts(chartConfig);

        // Line series
        LineConfig lineCfg = new LineConfig();
View Full Code Here

        addChart(chart);
    }

    private void showSpline() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.SPLINE);
        chartConfig.getGeneralChartConfig().setInverted(true);
        chartConfig.getGeneralChartConfig().setWidth(500);

        chartConfig.getTitle().setText("Atmosphere Temperature by Altitude");
        chartConfig.getSubtitle().setText(
                "According to the Standard Atmosphere Model");

        NumberXAxis xAxis = new NumberXAxis();
        xAxis.setReversed(false);
        xAxis.setTitle(new AxisTitle("Altitude"));
        xAxis.setLabel(new XAxisDataLabel());
        xAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value +'km';" + "}");
        xAxis.setMaxPadding(0.05);
        xAxis.setShowLastLabel(true);
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Temperature"));
        yAxis.setLineWidth(2);
        yAxis.setLabel(new YAxisDataLabel());
        yAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value + '°C';" + "}");
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        //
        Tooltip tooltip = new Tooltip();
        tooltip.setFormatterJsFunc("function() {"
                + " return '' + this.x +' km: '+ this.y +'°C';" + "}");
        chartConfig.setTooltip(tooltip);

        Legend legend = new Legend();
        legend.setEnabled(false);
        chartConfig.setLegend(legend);

        SplineConfig splineCfg = new SplineConfig();
        splineCfg.setMarker(new SymbolMarker(true));
        chartConfig.addSeriesConfig(splineCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("Temperature");
        series.setSeriesPoints(getPoints(series, new double[] { 0, 15 },
View Full Code Here

        addChart(chart);
    }

    private void showSplineWithSymbol() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.SPLINE);

        chartConfig.getTitle().setText("Monthly Average Temperature");
        chartConfig.getSubtitle().setText("Source: WorldClimate.com");

        CategoryAxis xAxis = new CategoryAxis();
        xAxis.setCategories(Arrays.asList("Jan", "Feb", "Mar", "Apr", "May",
                "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"));
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Temperature"));
        yAxis.setLabel(new YAxisDataLabel());
        yAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value + '°';" + "}");
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

        //
        Tooltip tooltip = new Tooltip();
        tooltip.setCrosshairs(true);
        tooltip.setShared(true);
        chartConfig.setTooltip(tooltip);

        SplineConfig splineCfg = new SplineConfig();
        SymbolMarker symbolMarker = new SymbolMarker(true);
        symbolMarker.setRadius(4);
        symbolMarker.setLineColor(new RGB(102, 102, 102));
        symbolMarker.setLineWidth(1);
        splineCfg.setMarker(symbolMarker);
        chartConfig.addSeriesConfig(splineCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        // Series
        splineCfg = new SplineConfig();
View Full Code Here

TOP

Related Classes of com.invient.vaadin.charts.InvientChartsConfig$State

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.