com.vaadin.flow.component.charts.model.

Class RangeSelector

  • All Implemented Interfaces:

    Serializable


    @Generated(value="This class is generated and shouldn\'t be modified",
               comments="Incorrect and missing API should be reported to https://github.com/vaadin/vaadin-charts-flow/issues/new")
    public class RangeSelector
    extends AbstractConfigurationObject

    The range selector is a tool for selecting ranges to display within the chart. It provides buttons to select preconfigured ranges in the chart, like 1 day, 1 week, 1 month etc. It also provides input boxes where min and max dates can be manually input.

    See Also:

    Serialized Form

    • Constructor Detail

      • RangeSelector

        public RangeSelector()
      • RangeSelector

        public RangeSelector(Boolean enabled)
    • Method Detail

      • setAllButtonsEnabled

        public void setAllButtonsEnabled(Boolean allButtonsEnabled)

        Whether to enable all buttons from the start. By default buttons are only enabled if the corresponding time range exists on the X axis, but enabling all buttons allows for dynamically loading different time ranges.

        Defaults to: false

      • setButtonPosition

        public void setButtonPosition(ButtonPosition buttonPosition)

        A fixed pixel position for the buttons. Supports two properties, x and y.

      • setButtonSpacing

        public void setButtonSpacing(Number buttonSpacing)

        The space in pixels between the buttons in the range selector.

        Defaults to: 0

      • setButtons

        public void setButtons(RangeSelectorButton... buttons)

        An array of configuration objects for the buttons.

        Defaults to
         buttons: [{
                        type: 'month',
                        count: 1,
                        text: '1m'
                }, {
                        type: 'month',
                        count: 3,
                        text: '3m'
                }, {
                        type: 'month',
                        count: 6,
                        text: '6m'
                }, {
                        type: 'ytd',
                        text: 'YTD'
                }, {
                        type: 'year',
                        count: 1,
                        text: '1y'
                }, {
                        type: 'all',
                        text: 'All'
                }]
         

      • setEnabled

        public void setEnabled(Boolean enabled)

        Enable or disable the range selector.

        Defaults to: true

      • setHeight

        public void setHeight(Number height)

        The height of the range selector, used to reserve space for buttons and input.

        Defaults to: 35

      • setInputBoxHeight

        public void setInputBoxHeight(Number inputBoxHeight)

        The pixel height of the date input boxes.

        Defaults to: 17

      • setInputBoxWidth

        public void setInputBoxWidth(Number inputBoxWidth)

        The pixel width of the date input boxes.

        Defaults to: 90

      • setInputDateFormat

        public void setInputDateFormat(String inputDateFormat)

        The date format in the input boxes when not selected for editing. Defaults to %b %e, %Y.

        Defaults to: %b %e %Y,

      • getInputDateParser

        public String getInputDateParser()
      • setInputDateParser

        public void setInputDateParser(String _fn_inputDateParser)
      • setInputEditDateFormat

        public void setInputEditDateFormat(String inputEditDateFormat)

        The date format in the input boxes when they are selected for editing. This must be a format that is recognized by JavaScript Date.parse.

        Defaults to: %Y-%m-%d

      • setInputEnabled

        public void setInputEnabled(Boolean inputEnabled)

        Enable or disable the date input boxes. Defaults to enabled when there is enough space, disabled if not (typically mobile).

      • setInputPosition

        public void setInputPosition(ButtonPosition inputPosition)

        Positioning for the input boxes. Allowed properties are align, verticalAlign, x and y.

        Defaults to: { align: "right" }

      • setSelected

        public void setSelected(Number selected)

        The index of the button to appear pre-selected.

        Defaults to: undefined