Package com.invient.vaadin.charts

Examples of com.invient.vaadin.charts.InvientChartsConfig$AxisBase$PlotLabel


        addChart(chart);
    }

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

        chartConfig.getTitle().setText("Area chart with negative values");

        CategoryAxis xAxis = new CategoryAxis();
        xAxis.setCategories(Arrays.asList("Apples", "Oranges", "Pears",
                "Grapes", "Bananas"));
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        chartConfig.getCredit().setEnabled(false);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("John");
        series.setSeriesPoints(getPoints(series, 5, 3, 4, 7, 2));
View Full Code Here


        addChart(chart);
    }

    private void showAreaInvertedAxes() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.AREA);
        chartConfig.getGeneralChartConfig().setInverted(true);

        chartConfig.getTitle().setText(
                "Average fruit consumption during one week");
        chartConfig.getSubtitle().setStyle(
                "{ position: 'absolute', right: '0px', bottom: '10px'}");

        Legend legend = new Legend();
        legend.setFloating(true);
        legend.setLayout(Layout.VERTICAL);
        legend.setPosition(new Position());
        legend.getPosition().setAlign(HorzAlign.RIGHT);
        legend.getPosition().setVertAlign(VertAlign.TOP);
        legend.getPosition().setX(-150);
        legend.getPosition().setY(100);
        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"));
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

        NumberYAxis yAxis = new NumberYAxis();
        yAxis.setTitle(new AxisTitle("Number of units"));
        yAxis.setMin(0.0);
        yAxis.setLabel(new YAxisDataLabel());
        yAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value; " + "}");
        LinkedHashSet<YAxis> yAxesSet = new LinkedHashSet<InvientChartsConfig.YAxis>();
        yAxesSet.add(yAxis);
        chartConfig.setYAxes(yAxesSet);

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

        AreaConfig areaCfg = new AreaConfig();
        areaCfg.setFillOpacity(0.5);
        chartConfig.addSeriesConfig(areaCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

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

        addChart(chart);
    }

    private void showAreaWithMissingPoints() {
        InvientChartsConfig chartConfig = new InvientChartsConfig();
        chartConfig.getGeneralChartConfig().setType(SeriesType.AREA);
        chartConfig.getGeneralChartConfig().setSpacing(new Spacing());
        chartConfig.getGeneralChartConfig().getSpacing().setBottom(30);

        chartConfig.getTitle().setText("Fruit consumption *");
        chartConfig.getSubtitle().setText(
                "* Jane\'s banana consumption is unknown");
        chartConfig.getSubtitle().setFloating(true);
        chartConfig.getSubtitle().setAlign(HorzAlign.RIGHT);
        chartConfig.getSubtitle().setVertAlign(VertAlign.BOTTOM);
        chartConfig.getSubtitle().setY(15);

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

        CategoryAxis xAxis = new CategoryAxis();
        xAxis.setCategories(Arrays.asList("Apples", "Pears", "Oranges",
                "Bananas", "Grapes", "Plums", "Strawberries", "Raspberries"));
        LinkedHashSet<XAxis> xAxesSet = new LinkedHashSet<InvientChartsConfig.XAxis>();
        xAxesSet.add(xAxis);
        chartConfig.setXAxes(xAxesSet);

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

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

        chartConfig.getCredit().setEnabled(false);

        AreaConfig areaCfg = new AreaConfig();
        areaCfg.setFillOpacity(0.5);
        chartConfig.addSeriesConfig(areaCfg);

        InvientCharts chart = new InvientCharts(chartConfig);

        XYSeries series = new XYSeries("John");
        series.setSeriesPoints(getPoints(series, 0, 1, 4, 4, 5, 2, 3, 7));
View Full Code Here

        addChart(chart);
    }

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

        chartConfig.getTitle().setText(
                "Historic and Estimated Worldwide Population Growth 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("Billions"));
        yAxis.setLabel(new YAxisDataLabel());
        yAxis.getLabel().setFormatterJsFunc(
                "function() {" + " return this.value / 1000; " + "}");

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

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

        AreaConfig areaCfg = new AreaConfig();
        areaCfg.setStacking(Stacking.NORMAL);
        areaCfg.setLineColor(new RGB(102, 102, 102));
        areaCfg.setLineWidth(1);

        SymbolMarker marker = new SymbolMarker();
        marker.setLineColor(new RGB(102, 102, 102));
        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 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

TOP

Related Classes of com.invient.vaadin.charts.InvientChartsConfig$AxisBase$PlotLabel

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.