Search in sources :

Example 86 with Configuration

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

the class ChartTypes method chartTypesGaugeConfigurationSnippet1.

public void chartTypesGaugeConfigurationSnippet1() {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    conf.setTitle("Speedometer");
    conf.getPane().setStartAngle(-135);
    conf.getPane().setEndAngle(135);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) Chart(com.vaadin.addon.charts.Chart)

Example 87 with Configuration

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

the class ChartTypes method chartTypesSolidGaugePlotoptionsSnippet1.

public void chartTypesSolidGaugePlotoptionsSnippet1() {
    Chart chart = new Chart(ChartType.SOLIDGAUGE);
    Configuration conf = chart.getConfiguration();
    PlotOptionsSolidgauge options = new PlotOptionsSolidgauge();
    // Move the value display box at the center a bit higher
    DataLabels dataLabels = new DataLabels();
    dataLabels.setY(-20);
    options.setDataLabels(dataLabels);
    conf.setPlotOptions(options);
}
Also used : DataLabels(com.vaadin.addon.charts.model.DataLabels) Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsSolidgauge(com.vaadin.addon.charts.model.PlotOptionsSolidgauge) Chart(com.vaadin.addon.charts.Chart)

Example 88 with Configuration

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

the class ChartTypes method chartTypesOhlcSnippet1.

public void chartTypesOhlcSnippet1() {
    Chart chart = new Chart(ChartType.OHLC);
    chart.setTimeline(true);
    Configuration configuration = chart.getConfiguration();
    configuration.getTitle().setText("AAPL Stock Price");
    DataSeries dataSeries = new DataSeries();
    Collection<OhlcData> dataBank = null;
    for (OhlcData data : dataBank) {
        OhlcItem item = new OhlcItem();
        item.setX(data.getDate());
        item.setLow(data.getLow());
        item.setHigh(data.getHigh());
        item.setClose(data.getClose());
        item.setOpen(data.getOpen());
        dataSeries.add(item);
    }
    configuration.setSeries(dataSeries);
    chart.drawChart(configuration);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) OhlcItem(com.vaadin.addon.charts.model.OhlcItem) DataSeries(com.vaadin.addon.charts.model.DataSeries) Chart(com.vaadin.addon.charts.Chart)

Example 89 with Configuration

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

the class BasicUse method basicUsePlotOptionsSnippet1.

public void basicUsePlotOptionsSnippet1() {
    Chart chart = new Chart(ChartType.COLUMN);
    Configuration conf = chart.getConfiguration();
    PlotOptionsLine plotOptions = new PlotOptionsLine();
    plotOptions.setMarker(new Marker(false));
    conf.setPlotOptions(plotOptions);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsLine(com.vaadin.addon.charts.model.PlotOptionsLine) Marker(com.vaadin.addon.charts.model.Marker) Chart(com.vaadin.addon.charts.Chart)

Example 90 with Configuration

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

the class BasicUse method basicUseDataSnippet1.

public void basicUseDataSnippet1() {
    Chart chart = new Chart(ChartType.COLUMN);
    Configuration conf = chart.getConfiguration();
    ListSeries series = new ListSeries("Diameter");
    series.setData(4900, 12100, 12800, 6800, 143000, 125000, 51100, 49500);
    conf.addSeries(series);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) ListSeries(com.vaadin.addon.charts.model.ListSeries) Chart(com.vaadin.addon.charts.Chart)

Aggregations

Configuration (com.vaadin.addon.charts.model.Configuration)257 Chart (com.vaadin.addon.charts.Chart)196 YAxis (com.vaadin.addon.charts.model.YAxis)100 DataSeries (com.vaadin.addon.charts.model.DataSeries)72 ListSeries (com.vaadin.addon.charts.model.ListSeries)70 XAxis (com.vaadin.addon.charts.model.XAxis)65 Test (org.junit.Test)58 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)56 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)54 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)51 Tooltip (com.vaadin.addon.charts.model.Tooltip)42 DataLabels (com.vaadin.addon.charts.model.DataLabels)41 Legend (com.vaadin.addon.charts.model.Legend)30 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)30 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)27 Elements (org.jsoup.select.Elements)27 Marker (com.vaadin.addon.charts.model.Marker)22 DesignContext (com.vaadin.ui.declarative.DesignContext)22 Element (org.jsoup.nodes.Element)22 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)20