Class PeriodSelector

java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.period.PeriodSelector
All Implemented Interfaces:
Serializable

public class PeriodSelector extends AbstractChartObject
Displays date input fields and predefined period buttons.
See documentation for properties of PeriodSelector JS object.
http://docs.amcharts.com/3/javascriptstockchart/PeriodSelector
See Also:
  • Constructor Details

    • PeriodSelector

      public PeriodSelector()
  • Method Details

    • getDateFormat

      public String getDateFormat()
      Returns:
      date format of date input fields
    • setDateFormat

      @StudioProperty(defaultValue="DD-MM-YYYY") public PeriodSelector setDateFormat(String dateFormat)
      Sets date format of date input fields. Note, only numeric date formats are allowed, so don't use "MMM" or "MMMM" month format, two-digit years "YY" is NOT supported in this setting. If not set the default value is "DD-MM-YYYY".
      Parameters:
      dateFormat - date format string
      Returns:
      period selector
    • getFromText

      public String getFromText()
      Returns:
      from text
    • setFromText

      @StudioProperty(defaultValue="From:") public PeriodSelector setFromText(String fromText)
      Sets text displayed next to "from" date input field. If not set the default value is "From:".
      Parameters:
      fromText - from text
      Returns:
      period selector
    • getHideOutOfScopePeriods

      public Boolean getHideOutOfScopePeriods()
      Returns:
      true if period buttons with date range bigger than available data are hidden
    • setHideOutOfScopePeriods

      @StudioProperty(defaultValue="true") public PeriodSelector setHideOutOfScopePeriods(Boolean hideOutOfScopePeriods)
      Set hideOutOfScopePeriods to false if period buttons with date range bigger than available data shouldn't be hidden. If not set the default value is true.
      Parameters:
      hideOutOfScopePeriods - hideOutOfScopePeriods option
      Returns:
      period selector
    • getInputFieldsEnabled

      public Boolean getInputFieldsEnabled()
      Returns:
      true if period selector displays "from" and "to" date input fields
    • setInputFieldsEnabled

      @StudioProperty(defaultValue="true") public PeriodSelector setInputFieldsEnabled(Boolean inputFieldsEnabled)
      Set inputFieldsEnabled to false if period selector shouldn't display "from" and "to" date input fields. If not set the default value is true.
      Parameters:
      inputFieldsEnabled - inputFieldsEnabled option
      Returns:
      period selector
    • getInputFieldWidth

      public Integer getInputFieldWidth()
      Returns:
      width of date input fields, in pixels
    • setInputFieldWidth

      @StudioProperty(defaultValue="100") public PeriodSelector setInputFieldWidth(Integer inputFieldWidth)
      Sets width of date input fields, in pixels. Works only if period selector is horizontal. If not set the default value is 100.
      Parameters:
      inputFieldWidth - width
      Returns:
      period selector
    • getPeriods

      public List<Period> getPeriods()
      Returns:
      list of periods
    • setPeriods

      @StudioElementsGroup(caption="Periods", xmlElement="periods") public PeriodSelector setPeriods(List<Period> periods)
      Sets list of predefined periods.
      Parameters:
      periods - list of periods
      Returns:
      period selector
    • addPeriods

      public PeriodSelector addPeriods(Period... periods)
      Adds periods.
      Parameters:
      periods - periods
      Returns:
      period selector
    • getPeriodsText

      public String getPeriodsText()
      Returns:
      text displayed next to predefined period buttons
    • setPeriodsText

      @StudioProperty(defaultValue="Zoom:") public PeriodSelector setPeriodsText(String periodsText)
      Sets text displayed next to predefined period buttons. If not set the default value is "Zoom:".
      Parameters:
      periodsText - periods text
      Returns:
      period selector
    • getPosition

      public Position getPosition()
      Returns:
      position
    • setPosition

      @StudioProperty(type=ENUMERATION, defaultValue="BOTTOM") public PeriodSelector setPosition(Position position)
      Sets position. If not set the default value is BOTTOM.
      Parameters:
      position - position
      Returns:
      period selector
    • getSelectFromStart

      public Boolean getSelectFromStart()
      Returns:
      true if predefined period buttons select a period from the beginning
    • setSelectFromStart

      @StudioProperty(defaultValue="false") public PeriodSelector setSelectFromStart(Boolean selectFromStart)
      Set selectFromStart to true if predefined period buttons should select a period from the beginning. If not set the default value is false.
      Parameters:
      selectFromStart - selectFromStart option
      Returns:
      period selector
    • getToText

      public String getToText()
      Returns:
      text displayed next to "to" date input field
    • setToText

      @StudioProperty(defaultValue="To:") public PeriodSelector setToText(String toText)
      Sets text displayed next to "to" date input field. If not set the default value is "To:".
      Parameters:
      toText - text
      Returns:
      period selector
    • getWidth

      public Integer getWidth()
      Returns:
      width of a period selector
    • setWidth

      @StudioProperty(defaultValue="180") public PeriodSelector setWidth(Integer width)
      Sets width of a period selector, when position is "left" or "right". If not set the default value is 180.
      Parameters:
      width - width
      Returns:
      period selector