Search in sources :

Example 66 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class GettingStarted method configuringTheColors.

public void configuringTheColors() {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    DataSeries girls = new DataSeries("Girls");
    DataSeries boys = new DataSeries("Boys");
    PlotOptionsLine girlsOpts = new PlotOptionsLine();
    girlsOpts.setColor(SolidColor.HOTPINK);
    girls.setPlotOptions(girlsOpts);
    PlotOptionsLine boysOpts = new PlotOptionsLine();
    boysOpts.setColor(SolidColor.BLUE);
    boys.setPlotOptions(boysOpts);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsLine(com.vaadin.addon.charts.model.PlotOptionsLine) DataSeries(com.vaadin.addon.charts.model.DataSeries) Chart(com.vaadin.addon.charts.Chart)

Example 67 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class GettingStarted method combinationChartPreparationsSnippet2.

public void combinationChartPreparationsSnippet2(VaadinRequest request) {
    Chart chart = new Chart();
    final VerticalLayout layout = new VerticalLayout();
    layout.addComponent(chart);
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Chart(com.vaadin.addon.charts.Chart)

Example 68 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class GettingStarted method addColumnsSnippet1.

public void addColumnsSnippet1(List<WeatherInfo> weatherInfo) {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    ListDataProvider<WeatherInfo> dataProvider = new ListDataProvider<>(weatherInfo);
    DataProviderSeries<WeatherInfo> humidity = new DataProviderSeries<>(dataProvider);
    humidity.setName("Humidity");
    humidity.setX(WeatherInfo::getInstant);
    humidity.setY(WeatherInfo::getMeanHumidity);
    humidity.setPlotOptions(new PlotOptionsColumn());
    conf.addSeries(humidity);
}
Also used : ListDataProvider(com.vaadin.data.provider.ListDataProvider) DataProviderSeries(com.vaadin.addon.charts.model.DataProviderSeries) Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsColumn(com.vaadin.addon.charts.model.PlotOptionsColumn) Chart(com.vaadin.addon.charts.Chart)

Example 69 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class GettingStarted method combinationChartPreparationsSnippet1.

public void combinationChartPreparationsSnippet1(VaadinRequest request) {
    Chart chart = new Chart();
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    ChartsData data = new ChartsData();
    layout.addComponent(chart);
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Chart(com.vaadin.addon.charts.Chart)

Example 70 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class ChartConfiguration method plotOptionsSnippet1.

public void plotOptionsSnippet1(Configuration conf) {
    Chart chart = new Chart();
    Configuration configuration = chart.getConfiguration();
    PlotOptionsColumn plotOptions = new PlotOptionsColumn();
    plotOptions.setStacking(Stacking.NORMAL);
    configuration.setPlotOptions(plotOptions);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsColumn(com.vaadin.addon.charts.model.PlotOptionsColumn) Chart(com.vaadin.addon.charts.Chart)

Aggregations

Chart (com.vaadin.addon.charts.Chart)243 Configuration (com.vaadin.addon.charts.model.Configuration)196 YAxis (com.vaadin.addon.charts.model.YAxis)105 DataSeries (com.vaadin.addon.charts.model.DataSeries)81 ListSeries (com.vaadin.addon.charts.model.ListSeries)76 XAxis (com.vaadin.addon.charts.model.XAxis)71 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)57 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)55 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)50 DataLabels (com.vaadin.addon.charts.model.DataLabels)45 Tooltip (com.vaadin.addon.charts.model.Tooltip)44 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)34 Legend (com.vaadin.addon.charts.model.Legend)29 Marker (com.vaadin.addon.charts.model.Marker)23 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)21 Style (com.vaadin.addon.charts.model.style.Style)20 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)19 Labels (com.vaadin.addon.charts.model.Labels)18 VerticalLayout (com.vaadin.ui.VerticalLayout)18 PlotOptionsSpline (com.vaadin.addon.charts.model.PlotOptionsSpline)16