Search in sources :

Example 6 with ContainerDataSeries

use of com.vaadin.v7.addon.charts.model.ContainerDataSeries in project charts by vaadin.

the class ChartWithExternalContainer method createContainerView1.

private ContainerDataSeries createContainerView1(Container vaadinContainer) {
    ContainerDataSeries container = new ContainerDataSeries(vaadinContainer);
    container.setName("Order item quantities");
    container.setPlotOptions(new PlotOptionsPie());
    container.setYPropertyId(ExampleUtil.ORDER_QUANTITY_PROPERTY_ID);
    container.setNamePropertyId(ExampleUtil.ORDER_DESCRIPTION_PROPERTY_ID);
    return container;
}
Also used : PlotOptionsPie(com.vaadin.addon.charts.model.PlotOptionsPie) ContainerDataSeries(com.vaadin.v7.addon.charts.model.ContainerDataSeries)

Example 7 with ContainerDataSeries

use of com.vaadin.v7.addon.charts.model.ContainerDataSeries in project charts by vaadin.

the class ContainerWithLotsOfData method createContainer.

@SuppressWarnings("unchecked")
private ContainerDataSeries createContainer() {
    IndexedContainer vaadinContainer = new IndexedContainer();
    ContainerDataSeries container = new ContainerDataSeries(vaadinContainer);
    vaadinContainer.addContainerProperty("y", Number.class, null);
    for (int i = 0; i < getContainerData().length; i++) {
        Item item = vaadinContainer.addItem(i);
        item.getItemProperty("y").setValue(getContainerData()[i]);
    }
    container.setName("USD to EUR");
    container.setPlotOptions(new PlotOptionsArea());
    container.setYPropertyId("y");
    return container;
}
Also used : Item(com.vaadin.v7.data.Item) PlotOptionsArea(com.vaadin.addon.charts.model.PlotOptionsArea) IndexedContainer(com.vaadin.v7.data.util.IndexedContainer) ContainerDataSeries(com.vaadin.v7.addon.charts.model.ContainerDataSeries)

Aggregations

ContainerDataSeries (com.vaadin.v7.addon.charts.model.ContainerDataSeries)7 IndexedContainer (com.vaadin.v7.data.util.IndexedContainer)3 Component (com.vaadin.ui.Component)2 HorizontalLayout (com.vaadin.ui.HorizontalLayout)2 Item (com.vaadin.v7.data.Item)2 Chart (com.vaadin.addon.charts.Chart)1 Configuration (com.vaadin.addon.charts.model.Configuration)1 DataLabelsRange (com.vaadin.addon.charts.model.DataLabelsRange)1 PlotOptionsArea (com.vaadin.addon.charts.model.PlotOptionsArea)1 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)1 PlotOptionsColumnrange (com.vaadin.addon.charts.model.PlotOptionsColumnrange)1 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)1 Tooltip (com.vaadin.addon.charts.model.Tooltip)1 XAxis (com.vaadin.addon.charts.model.XAxis)1 YAxis (com.vaadin.addon.charts.model.YAxis)1 Container (com.vaadin.v7.data.Container)1 Before (org.junit.Before)1