Class DataSet.Source<T extends DataItem>

Type Parameters:
T - data item class type
All Implemented Interfaces:
Serializable
Enclosing class:
DataSet

public static class DataSet.Source<T extends DataItem> extends ChartDataObservableObject
Source data. May be associated with a data container or another provided data provider. Serialized only in row based key-value format (object array), where the keys indicate category field.
Serialization example:

 [
     // {category field}, {value field #1}, {value field #2}
     {"product": "Matcha Latte", "count": 823, "score": 95.8},
     {"product": "Milk Tea", "count": 235, "score": 81.4},
     {"product": "Cheese Cocoa", "count": 1042, "score": 91.2},
     {"product": "Walnut Brownie", "count": 988, "score": 76.9}
 ]
 
See Also:
  • Field Details

    • dataProvider

      protected com.vaadin.flow.data.provider.DataProvider<T extends DataItem,?> dataProvider
    • dataProviderItemSetChangeRegistration

      protected com.vaadin.flow.shared.Registration dataProviderItemSetChangeRegistration
    • categoryField

      protected String categoryField
    • valueFields

      protected List<String> valueFields
  • Constructor Details

    • Source

      public Source()
  • Method Details

    • getDataProvider

      public com.vaadin.flow.data.provider.DataProvider<T,?> getDataProvider()
    • setDataProvider

      public void setDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)
    • onDataProviderChange

      protected void onDataProviderChange()
    • onItemSetChangeListener

      protected void onItemSetChangeListener(ChartItems.ItemSetChangeEvent<T> event)
    • getCategoryField

      public String getCategoryField()
    • setCategoryField

      public void setCategoryField(String categoryField)
    • getValueFields

      public List<String> getValueFields()
    • setValueFields

      public void setValueFields(String... valueFields)
    • addValueFields

      public void addValueFields(String... valueFields)
    • addValueField

      public void addValueField(String field)
    • withDataProvider

      public DataSet.Source<T> withDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)
    • withCategoryField

      public DataSet.Source<T> withCategoryField(String categoryField)
    • withValueFields

      public DataSet.Source<T> withValueFields(String... fields)
    • withValueField

      public DataSet.Source<T> withValueField(String field)
    • afterChartSetup

      protected void afterChartSetup()
      Specified by:
      afterChartSetup in class ChartDataObservableObject