Search in sources :

Example 1 with DataSeriesItem3d

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

the class WaterfallChartExample method item.

public DataSeriesItem item(int x, int y, int z) {
    DataSeriesItem3d dataSeriesItem = new DataSeriesItem3d();
    dataSeriesItem.setX(x);
    dataSeriesItem.setY(y);
    dataSeriesItem.setZ(z);
    return dataSeriesItem;
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d)

Example 2 with DataSeriesItem3d

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

the class Basic3DScatter method fillSeries.

private void fillSeries(DataSeries higherX, DataSeries higherY, DataSeries higherZ) {
    Random random = new Random(7);
    for (int i = 0; i < 300; i++) {
        double lng = random.nextDouble() * 2 * Math.PI;
        double lat = random.nextDouble() * Math.PI - Math.PI / 2;
        double x = Math.cos(lat) * Math.sin(lng);
        double y = Math.sin(lat);
        double z = Math.cos(lng) * Math.cos(lat);
        DataSeriesItem3d point = new DataSeriesItem3d(x, y, z);
        if (x > y && x > z) {
            higherX.add(point);
        } else if (y > x && y > z) {
            higherY.add(point);
        } else {
            higherZ.add(point);
        }
    }
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d) Random(java.util.Random)

Example 3 with DataSeriesItem3d

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

the class BubbleChartExample method item.

public DataSeriesItem item(int x, int y, int z) {
    DataSeriesItem3d dataSeriesItem = new DataSeriesItem3d();
    dataSeriesItem.setX(x);
    dataSeriesItem.setY(y);
    dataSeriesItem.setZ(z);
    return dataSeriesItem;
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d)

Example 4 with DataSeriesItem3d

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

the class BasicUse method basicUse3dDistanceSnippet2.

public void basicUse3dDistanceSnippet2() {
    double x = 3.2;
    double z = 3.3;
    double y = 2.3;
    Options3d options3d = new Options3d();
    DataSeriesItem3d item = new DataSeriesItem3d(x, y, z * options3d.getDepth().doubleValue());
    double distance = 43.2;
    // Grayness
    int gr = (int) (distance * 75);
    Marker marker = new Marker(true);
    marker.setRadius(1 + 10 / distance);
    marker.setFillColor(new SolidColor(gr, gr, gr));
    item.setMarker(marker);
    DataSeries series = new DataSeries();
    series.add(item);
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) DataSeries(com.vaadin.addon.charts.model.DataSeries) Marker(com.vaadin.addon.charts.model.Marker) Options3d(com.vaadin.addon.charts.model.Options3d)

Example 5 with DataSeriesItem3d

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

the class ThreeDAxisConfiguration method fillSeries.

private void fillSeries(DataSeries higherX, DataSeries higherY, DataSeries higherZ) {
    Random random = new Random(7);
    for (int i = 0; i < 300; i++) {
        double lng = random.nextDouble() * 2 * Math.PI;
        double lat = random.nextDouble() * Math.PI - Math.PI / 2;
        double x = Math.cos(lat) * Math.sin(lng);
        double y = Math.sin(lat);
        double z = Math.cos(lng) * Math.cos(lat);
        DataSeriesItem3d point = new DataSeriesItem3d(x, y, z);
        if (x > y && x > z) {
            higherX.add(point);
        } else if (y > x && y > z) {
            higherY.add(point);
        } else {
            higherZ.add(point);
        }
    }
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d) Random(java.util.Random)

Aggregations

DataSeriesItem3d (com.vaadin.addon.charts.model.DataSeriesItem3d)9 DataSeries (com.vaadin.addon.charts.model.DataSeries)3 Random (java.util.Random)3 Chart (com.vaadin.addon.charts.Chart)2 Configuration (com.vaadin.addon.charts.model.Configuration)2 Marker (com.vaadin.addon.charts.model.Marker)2 Options3d (com.vaadin.addon.charts.model.Options3d)2 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)2 PlotOptionsBubble (com.vaadin.addon.charts.model.PlotOptionsBubble)1 XAxis (com.vaadin.addon.charts.model.XAxis)1 YAxis (com.vaadin.addon.charts.model.YAxis)1 GradientColor (com.vaadin.addon.charts.model.style.GradientColor)1