Search in sources :

Example 1 with ZAxis

use of com.vaadin.addon.charts.model.ZAxis in project charts by vaadin.

the class Basic3DScatter method createScatterChart.

private Chart createScatterChart() {
    final Chart scatterChart = new Chart(ChartType.SCATTER);
    scatterChart.setId("chart");
    scatterChart.getConfiguration().disableCredits();
    scatterChart.getConfiguration().setTitle("Points of a sphere");
    PlotOptionsScatter scatterOptions = new PlotOptionsScatter();
    scatterOptions.setAnimation(false);
    scatterOptions.setPointStart(1);
    DataSeries higherX = new DataSeries();
    higherX.setName("Higher X");
    DataSeries higherY = new DataSeries();
    higherY.setName("Higher Y");
    DataSeries higherZ = new DataSeries();
    higherZ.setName("Higher Z");
    fillSeries(higherX, higherY, higherZ);
    scatterChart.getConfiguration().addSeries(higherX);
    scatterChart.getConfiguration().addSeries(higherY);
    scatterChart.getConfiguration().addSeries(higherZ);
    XAxis x = scatterChart.getConfiguration().getxAxis();
    x.setGridLineWidth(1);
    x.setExtremes(-3, 3);
    if (getCurrentTheme().getxAxis().getGridLineColor() != null) {
        x.setGridLineColor(getCurrentTheme().getxAxis().getGridLineColor());
    }
    YAxis y = scatterChart.getConfiguration().getyAxis();
    y.setExtremes(-1, 1);
    ZAxis z = scatterChart.getConfiguration().getzAxis();
    z.setMin(-1);
    z.setMax(1);
    Options3d options3d = new Options3d();
    options3d.setEnabled(true);
    options3d.setAlpha(10);
    options3d.setBeta(30);
    options3d.setDepth(80);
    options3d.setViewDistance(40);
    Frame frame = new Frame();
    Bottom bottom = new Bottom();
    bottom.setSize(1);
    frame.setBottom(bottom);
    options3d.setFrame(frame);
    scatterChart.getConfiguration().getChart().setOptions3d(options3d);
    scatterChart.drawChart();
    return scatterChart;
}
Also used : Frame(com.vaadin.addon.charts.model.Frame) PlotOptionsScatter(com.vaadin.addon.charts.model.PlotOptionsScatter) ZAxis(com.vaadin.addon.charts.model.ZAxis) Bottom(com.vaadin.addon.charts.model.Bottom) DataSeries(com.vaadin.addon.charts.model.DataSeries) Chart(com.vaadin.addon.charts.Chart) XAxis(com.vaadin.addon.charts.model.XAxis) Options3d(com.vaadin.addon.charts.model.Options3d) YAxis(com.vaadin.addon.charts.model.YAxis)

Example 2 with ZAxis

use of com.vaadin.addon.charts.model.ZAxis in project charts by vaadin.

the class PointClickCoordinatesScatterChart method createChart.

@Override
protected Chart createChart() {
    Chart chart = super.createChart();
    Configuration conf = chart.getConfiguration();
    XAxis x = conf.getxAxis();
    x.setGridLineWidth(1);
    x.setExtremes(-3, 3);
    if (getCurrentTheme().getxAxis().getGridLineColor() != null) {
        x.setGridLineColor(getCurrentTheme().getxAxis().getGridLineColor());
    }
    YAxis y = conf.getyAxis();
    y.setExtremes(-1, 1);
    ZAxis z = conf.getzAxis();
    z.setMin(-1);
    z.setMax(1);
    Options3d options3d = new Options3d();
    options3d.setEnabled(true);
    options3d.setAlpha(10);
    options3d.setBeta(30);
    options3d.setDepth(80);
    options3d.setViewDistance(40);
    Frame frame = new Frame();
    Bottom bottom = new Bottom();
    bottom.setSize(1);
    frame.setBottom(bottom);
    options3d.setFrame(frame);
    conf.getChart().setOptions3d(options3d);
    chart.drawChart();
    return chart;
}
Also used : Frame(com.vaadin.addon.charts.model.Frame) Configuration(com.vaadin.addon.charts.model.Configuration) ZAxis(com.vaadin.addon.charts.model.ZAxis) Bottom(com.vaadin.addon.charts.model.Bottom) Chart(com.vaadin.addon.charts.Chart) XAxis(com.vaadin.addon.charts.model.XAxis) Options3d(com.vaadin.addon.charts.model.Options3d) YAxis(com.vaadin.addon.charts.model.YAxis)

Aggregations

Chart (com.vaadin.addon.charts.Chart)2 Bottom (com.vaadin.addon.charts.model.Bottom)2 Frame (com.vaadin.addon.charts.model.Frame)2 Options3d (com.vaadin.addon.charts.model.Options3d)2 XAxis (com.vaadin.addon.charts.model.XAxis)2 YAxis (com.vaadin.addon.charts.model.YAxis)2 ZAxis (com.vaadin.addon.charts.model.ZAxis)2 Configuration (com.vaadin.addon.charts.model.Configuration)1 DataSeries (com.vaadin.addon.charts.model.DataSeries)1 PlotOptionsScatter (com.vaadin.addon.charts.model.PlotOptionsScatter)1