Class DataSet

java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.dataset.DataSet
All Implemented Interfaces:
Serializable

public class DataSet extends AbstractChartObject
Holds all information about data.
See documentation for properties of DataSet JS object.
http://docs.amcharts.com/3/javascriptstockchart/DataSet
See Also:
  • Constructor Details

    • DataSet

      public DataSet()
  • Method Details

    • getId

      public String getId()
    • setId

      @StudioProperty public DataSet setId(String id)
    • getCategoryField

      public String getCategoryField()
      Returns:
      category field name
    • setCategoryField

      @StudioProperty(type=PROPERTY_PATH_REF) public DataSet setCategoryField(String categoryField)
      Sets category field name in your data provider. It needs to contains a date/time value. If you are specifying dates as strings in your data, i.e. "2015-01-05", it is strongly recommend setting dataDateFormat as well.
      Parameters:
      categoryField - category field name
      Returns:
      data set
    • getColor

      public Color getColor()
      Returns:
      color of the data set
    • setColor

      @StudioProperty(type=OPTIONS) public DataSet setColor(Color color)
      Sets color of the data set. One of colors from colors array will be used if not set.
      Parameters:
      color - color
      Returns:
      data set
    • getCompared

      public Boolean getCompared()
      Returns:
      true if data set is selected for comparing
    • setCompared

      @StudioProperty(defaultValue="false") public DataSet setCompared(Boolean compared)
      Set to true if this data set selected for comparing. If not set the default value is false.
      Parameters:
      compared - compared option
      Returns:
      data set
    • getDataProvider

      public DataProvider getDataProvider()
      Returns:
      data provider
    • setDataProvider

      @StudioProperty(name="dataContainer", type=DATACONTAINER_REF) public DataSet setDataProvider(DataProvider dataProvider)
      Sets data provider to the data set. An array of data points to be used as data. Important, the data points needs to come pre-ordered in ascending order. Data with incorrect order might result in visual and functional glitches on the chart.
      Parameters:
      dataProvider - data provider
      Returns:
      data set
    • fireDataProviderChanged

      protected void fireDataProviderChanged()
    • getFieldMappings

      public List<FieldMapping> getFieldMappings()
      Returns:
      list of field mappings
    • setFieldMappings

      @StudioElementsGroup(caption="Field Mappings", xmlElement="fieldMappings") public DataSet setFieldMappings(List<FieldMapping> fieldMappings)
      Sets list of field mappings. Field mapping is an object with fromField and toField properties. fromField is a name of your value field in data provider. toField might be chosen freely, it will be used to set value/open/close/high/low fields for the StockGraph.
      Parameters:
      fieldMappings - list of field mappings
      Returns:
      data set
    • addFieldMappings

      public DataSet addFieldMappings(FieldMapping... fieldMappings)
      Adds field mappings.
      Parameters:
      fieldMappings - field mappings
      Returns:
      data set
    • getShowInCompare

      public Boolean getShowInCompare()
      Returns:
      true if this data set is visible in "compare to" list
    • setShowInCompare

      @StudioProperty(defaultValue="true") public DataSet setShowInCompare(Boolean showInCompare)
      Set showInCompare to false if this data set shouldn't be visible in "compare to" list. If not set the default value is true.
      Parameters:
      showInCompare - showInCompare option
      Returns:
      data set
    • getShowInSelect

      public Boolean getShowInSelect()
      Returns:
      true if this data set is visible in "select" dropdown
    • setShowInSelect

      @StudioProperty(defaultValue="true") public DataSet setShowInSelect(Boolean showInSelect)
      Set showInSelect to false if this data set shouldn't be visible in "select" dropdown. If not set the default value is true.
      Parameters:
      showInSelect - showInSelect option
      Returns:
      data set
    • getStockEvents

      public List<StockEvent> getStockEvents()
      Returns:
      list of stock events
    • setStockEvents

      @StudioElementsGroup(caption="Stock Events", xmlElement="stockEvents") public DataSet setStockEvents(List<StockEvent> stockEvents)
      Sets list of stock events.
      Parameters:
      stockEvents - list of stock events
      Returns:
      data set
    • addStockEvents

      public DataSet addStockEvents(StockEvent... stockEvents)
      Adds stock events.
      Parameters:
      stockEvents - stock events
      Returns:
      data set
    • getTitle

      public String getTitle()
      Returns:
      data set title
    • setTitle

      @StudioProperty public DataSet setTitle(String title)
      Sets data set title.
      Parameters:
      title - title
      Returns:
      data set
    • getWiredFields

      public List<String> getWiredFields()
      Returns:
      fields that are bound to the data set
    • addDataProviderChangeListener

      public void addDataProviderChangeListener(DataSet.DataProviderChangeListener listener)
    • removeDataProviderChangeListener

      public void removeDataProviderChangeListener(DataSet.DataProviderChangeListener listener)