com.vaadin.flow.component.charts.model.
Class RangeSelector
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.model.RangeSelector
-
All Implemented Interfaces:
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:
-
-
Constructor Summary
Constructors Constructor Description RangeSelector()
RangeSelector(Boolean enabled)
-
Method Summary
All Methods Modifier and Type Method Description void
addButton(RangeSelectorButton button)
Adds button to the buttons array
Boolean
getAllButtonsEnabled()
ButtonPosition
getButtonPosition()
RangeSelectorButton[]
getButtons()
Number
getButtonSpacing()
ButtonTheme
getButtonTheme()
Boolean
getEnabled()
Number
getHeight()
Color
getInputBoxBorderColor()
Number
getInputBoxHeight()
Number
getInputBoxWidth()
String
getInputDateFormat()
String
getInputDateParser()
String
getInputEditDateFormat()
Boolean
getInputEnabled()
ButtonPosition
getInputPosition()
Style
getInputStyle()
Style
getLabelStyle()
Number
getSelected()
void
removeButton(RangeSelectorButton button)
Removes first occurrence of button in buttons array
void
setAllButtonsEnabled(Boolean allButtonsEnabled)
Whether to enable all buttons from the start.
void
setButtonPosition(ButtonPosition buttonPosition)
A fixed pixel position for the buttons.
void
setButtons(RangeSelectorButton... buttons)
An array of configuration objects for the buttons.
void
setButtonSpacing(Number buttonSpacing)
The space in pixels between the buttons in the range selector.
void
setButtonTheme(ButtonTheme buttonTheme)
A collection of attributes for the buttons.
void
setEnabled(Boolean enabled)
Enable or disable the range selector.
void
setHeight(Number height)
The height of the range selector, used to reserve space for buttons and input.
void
setInputBoxBorderColor(Color inputBoxBorderColor)
The border color of the date input boxes.
void
setInputBoxHeight(Number inputBoxHeight)
The pixel height of the date input boxes.
void
setInputBoxWidth(Number inputBoxWidth)
The pixel width of the date input boxes.
void
setInputDateFormat(String inputDateFormat)
The date format in the input boxes when not selected for editing.
void
setInputDateParser(String _fn_inputDateParser)
void
setInputEditDateFormat(String inputEditDateFormat)
The date format in the input boxes when they are selected for editing.
void
setInputEnabled(Boolean inputEnabled)
Enable or disable the date input boxes.
void
setInputPosition(ButtonPosition inputPosition)
Positioning for the input boxes.
void
setInputStyle(Style inputStyle)
CSS for the HTML inputs in the range selector.
void
setLabelStyle(Style labelStyle)
CSS styles for the labels - the Zoom, From and To texts.
void
setSelected(Number selected)
The index of the button to appear pre-selected.
-
-
-
Constructor Detail
-
RangeSelector
public RangeSelector()
-
RangeSelector
public RangeSelector(Boolean enabled)
-
-
Method Detail
-
getAllButtonsEnabled
public Boolean getAllButtonsEnabled()
See Also:
-
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
-
getButtonPosition
public ButtonPosition getButtonPosition()
See Also:
-
setButtonPosition
public void setButtonPosition(ButtonPosition buttonPosition)
A fixed pixel position for the buttons. Supports two properties,
x
andy
.
-
getButtonSpacing
public Number getButtonSpacing()
See Also:
-
setButtonSpacing
public void setButtonSpacing(Number buttonSpacing)
The space in pixels between the buttons in the range selector.
Defaults to: 0
-
getButtonTheme
public ButtonTheme getButtonTheme()
See Also:
-
setButtonTheme
public void setButtonTheme(ButtonTheme buttonTheme)
A collection of attributes for the buttons. The object takes SVG attributes like
fill
,stroke
,stroke-width
, as well asstyle
, a collection of CSS properties for the text.The object can also be extended with states, so you can set presentational options for
hover
,select
ordisabled
button states.CSS styles for the text label.
In styled mode, the buttons are styled by the
.highcharts-range-selector-buttons .highcharts-button
rule with its different states.
-
getButtons
public RangeSelectorButton[] getButtons()
See Also:
-
setButtons
public void setButtons(RangeSelectorButton... buttons)
An array of configuration objects for the buttons.
Defaults tobuttons: [{ 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' }]
-
addButton
public void addButton(RangeSelectorButton button)
Adds button to the buttons array
Parameters:
button
- to addSee Also:
-
removeButton
public void removeButton(RangeSelectorButton button)
Removes first occurrence of button in buttons array
Parameters:
button
- to removeSee Also:
-
getEnabled
public Boolean getEnabled()
See Also:
-
setEnabled
public void setEnabled(Boolean enabled)
Enable or disable the range selector.
Defaults to: true
-
getHeight
public Number getHeight()
See Also:
-
setHeight
public void setHeight(Number height)
The height of the range selector, used to reserve space for buttons and input.
Defaults to: 35
-
getInputBoxBorderColor
public Color getInputBoxBorderColor()
See Also:
-
setInputBoxBorderColor
public void setInputBoxBorderColor(Color inputBoxBorderColor)
The border color of the date input boxes.
Defaults to: #cccccc
-
getInputBoxHeight
public Number getInputBoxHeight()
See Also:
-
setInputBoxHeight
public void setInputBoxHeight(Number inputBoxHeight)
The pixel height of the date input boxes.
Defaults to: 17
-
getInputBoxWidth
public Number getInputBoxWidth()
See Also:
-
setInputBoxWidth
public void setInputBoxWidth(Number inputBoxWidth)
The pixel width of the date input boxes.
Defaults to: 90
-
getInputDateFormat
public String getInputDateFormat()
See Also:
-
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)
-
getInputEditDateFormat
public String getInputEditDateFormat()
See Also:
-
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
-
getInputEnabled
public Boolean getInputEnabled()
See Also:
-
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).
-
getInputPosition
public ButtonPosition getInputPosition()
See Also:
-
setInputPosition
public void setInputPosition(ButtonPosition inputPosition)
Positioning for the input boxes. Allowed properties are
align
,verticalAlign
,x
andy
.Defaults to: { align: "right" }
-
getInputStyle
public Style getInputStyle()
See Also:
-
setInputStyle
public void setInputStyle(Style inputStyle)
CSS for the HTML inputs in the range selector.
In styled mode, the inputs are styled by the
.highcharts-range-input text
rule in SVG mode, andinput.highcharts-range-selector
when active.
-
getLabelStyle
public Style getLabelStyle()
See Also:
-
setLabelStyle
public void setLabelStyle(Style labelStyle)
CSS styles for the labels - the Zoom, From and To texts.
In styled mode, the labels are styled by the
.highcharts-range-label
class.
-
getSelected
public Number getSelected()
See Also:
-
setSelected
public void setSelected(Number selected)
The index of the button to appear pre-selected.
Defaults to: undefined
-
-