Package io.jmix.charts.model
Class Scrollbar
java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.Scrollbar
- All Implemented Interfaces:
Serializable
Creates a scrollbar for
See documentation for properties of ChartScrollbar JS Object.
http://docs.amcharts.com/3/javascriptcharts/ChartScrollbar
SerialChartModelImpl
and XYChartModelImpl
charts.
See documentation for properties of ChartScrollbar JS Object.
http://docs.amcharts.com/3/javascriptcharts/ChartScrollbar
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
getGraph()
setAccessibleLabel
(String accessibleLabel) Sets text which screen readers will read if user rolls-over or sets focus using tab key (this is possible only ifAbstractGraph.tabIndex
is set to some number) on the grips or draggable part of a scrollbar.setAutoGridCount
(Boolean autoGridCount) Set autoGridCount to true if a number of gridCount should be specified automatically, according to the axis size.@Max(1L) @Min(0L) Scrollbar
setBackgroundAlpha
(Double backgroundAlpha) Sets background opacity.setBackgroundColor
(Color backgroundColor) Sets background color of the scrollbar.Sets text color.setDragCursorDown
(String dragCursorDown) Sets drag cursor.setDragCursorHover
(String dragCursorHover) Sets drag cursor hover.setDragIcon
(String dragIcon) Sets file name of scrollbar drag (resize grip) icon.setDragIconHeight
(Integer dragIconHeight) Sets height of resize grip image.setDragIconWidth
(Integer dragIconWidth) Sets width of resize grip image.setEnabled
(Boolean enabled) Set enabled to false if you don't want scrollbar should be enabled.Sets the graph which will be displayed in the scrollbar.@Max(1L) @Min(0L) Scrollbar
setGraphFillAlpha
(Double graphFillAlpha) Sets graph fill opacity.setGraphFillColor
(Color graphFillColor) Sets graph fill color.@Max(1L) @Min(0L) Scrollbar
setGraphLineAlpha
(Double graphLineAlpha) Sets graph line opacity.setGraphLineColor
(Color graphLineColor) Sets graph line color.setGraphType
(GraphType graphType) Sets the graph type.@Max(1L) @Min(0L) Scrollbar
setGridAlpha
(Double gridAlpha) Sets grid opacity.setGridColor
(Color gridColor) Sets grid color.setGridCount
(Integer gridCount) Sets the number of grid lines.setHideResizeGrips
(Boolean hideResizeGrips) Set hideResizeGrips to true if resize grips should be hidden when the mouse is away from the scrollbar.void
setHResizeCursor
(String hResizeCursor) Sets mouse cursor type shown when user hovers horizontal cursor's resize grips.void
setHResizeCursorDown
(String hResizeCursorDown) Sets CSS value of cursor displayed when mouse is pressed down over horizontal cursor's resize grip.void
setHResizeCursorHover
(String hResizeCursorHover) Sets CSS value of cursor displayed when hovering over horizontal cursor's resize grip.setIgnoreCustomColors
(Boolean ignoreCustomColors) Set ignoreCustomColors to true to use scrollbar's graph colors.setMaximum
(Double maximum) Sets maximum value ofValueAxis
of scrollbar.setMinimum
(Double minimum) Sets minimum value ofValueAxis
of scrollbar.Sets distance from plot area to scrollbar, in pixels.setOppositeAxis
(Boolean oppositeAxis) Set oppositeAxis to false and scrollbar will be placed next to category/value axis.setResizeEnabled
(Boolean resizeEnabled) Set resizeEnabled to false if you want prevent the chart scroll bar to change selection scope.setScrollbarHeight
(Integer scrollbarHeight) Sets height (width, if chart is rotated) of a scrollbar.setScrollDuration
(Double scrollDuration) Sets duration of scrolling, when the user clicks on scrollbar's background, in seconds.@Max(1L) @Min(0L) Scrollbar
setSelectedBackgroundAlpha
(Double selectedBackgroundAlpha) Sets selected background opacity.setSelectedBackgroundColor
(Color selectedBackgroundColor) Sets selected background color.@Max(1L) @Min(0L) Scrollbar
setSelectedGraphFillAlpha
(Double selectedGraphFillAlpha) Sets selected graph's fill opacity.setSelectedGraphFillColor
(Color selectedGraphFillColor) Sets selected graph's fill color.@Max(1L) @Min(0L) Scrollbar
setSelectedGraphLineAlpha
(Double selectedGraphLineAlpha) Sets selected graph's line opacity.setSelectedGraphLineColor
(Color selectedGraphLineColor) Sets selected graph's line color.setTabIndex
(Integer tabIndex) Sets tab index to scrollbar.setUpdateOnReleaseOnly
(Boolean updateOnReleaseOnly) Set updateOnReleaseOnly to true if the chart should be updated only at the moment when user releases mouse button.void
setVResizeCursor
(String vResizeCursor) Sets mouse cursor type shown when user hovers vertical cursor's resize grips.void
setVResizeCursorDown
(String vResizeCursorDown) Sets CSS value of cursor displayed when mouse is pressed down over vertical cursor's resize grip.void
setVResizeCursorHover
(String vResizeCursorHover) Sets CSS value of cursor displayed when hovering over vertical cursor's resize grip.
-
Constructor Details
-
Scrollbar
public Scrollbar()
-
-
Method Details
-
getAutoGridCount
- Returns:
- true if a number of gridCount is specified automatically, according to the axis size
-
setAutoGridCount
Set autoGridCount to true if a number of gridCount should be specified automatically, according to the axis size. If not set the default value is false.- Parameters:
autoGridCount
- autoGridCount option- Returns:
- scrollbar
-
getBackgroundAlpha
- Returns:
- background opacity
-
setBackgroundAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setBackgroundAlpha(Double backgroundAlpha) Sets background opacity. If not set the default value is 1.- Parameters:
backgroundAlpha
- background opacity- Returns:
- scrollbar
-
getBackgroundColor
- Returns:
- background color of the scrollbar
-
setBackgroundColor
@StudioProperty(type=OPTIONS, defaultValue="#D4D4D4") public Scrollbar setBackgroundColor(Color backgroundColor) Sets background color of the scrollbar. If not set the default value is #D4D4D4.- Parameters:
backgroundColor
- background color of the scrollbar- Returns:
- scrollbar
-
getColor
- Returns:
- text color
-
setColor
Sets text color. If not set the default value is #FFFFFF.- Parameters:
color
- text color- Returns:
- scrollbar
-
getDragIconHeight
- Returns:
- drag icon height
-
setDragIconHeight
Sets height of resize grip image. Note, you should also update the image in amcharts/images folder if you don't want it to be distorted because of resizing. If not set the default value is 35.- Parameters:
dragIconHeight
- drag icon height- Returns:
- scrollbar
-
getDragIconWidth
- Returns:
- drag icon width
-
setDragIconWidth
Sets width of resize grip image. Note, you should also update the image in amcharts/images folder if you don't want it to be distorted because of resizing. If not set the default value is 35.- Parameters:
dragIconWidth
- drag icon width- Returns:
- scrollbar
-
getGraphFillAlpha
- Returns:
- graph fill opacity
-
setGraphFillAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setGraphFillAlpha(Double graphFillAlpha) Sets graph fill opacity. Value range is 0 - 1. If not set the default value is 1.- Parameters:
graphFillAlpha
- graph fill opacity- Returns:
- scrollbar
-
getGraphFillColor
- Returns:
- graph fill color
-
setGraphFillColor
@StudioProperty(type=OPTIONS, defaultValue="#BBBBBB") public Scrollbar setGraphFillColor(Color graphFillColor) Sets graph fill color. If not set the default value is #BBBBBB.- Parameters:
graphFillColor
- graph fill color- Returns:
- scrollbar
-
getGraphLineAlpha
- Returns:
- graph line opacity
-
setGraphLineAlpha
@StudioProperty(defaultValue="0") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setGraphLineAlpha(Double graphLineAlpha) Sets graph line opacity. Value range is 0 - 1. If not set the default value is 0.- Parameters:
graphLineAlpha
- graph line opacity- Returns:
- scrollbar
-
getGraphLineColor
- Returns:
- graph line color
-
setGraphLineColor
@StudioProperty(type=OPTIONS, defaultValue="#BBBBBB") public Scrollbar setGraphLineColor(Color graphLineColor) Sets graph line color. If not set the default value is #BBBBBB.- Parameters:
graphLineColor
- graph line color- Returns:
- scrollbar
-
getGraphType
- Returns:
- graph type
-
setGraphType
Sets the graph type. By default the graph type is the same as the original graph's type, however in case of candlestick or ohlc you might want to show line graph in the scrollbar. Possible values are: line, column, step, smoothedLine, candlestick, ohlc.- Parameters:
graphType
- graph type- Returns:
- scrollbar
-
getGridAlpha
- Returns:
- grid opacity
-
setGridAlpha
@StudioProperty(defaultValue="0.7") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setGridAlpha(Double gridAlpha) Sets grid opacity. Value range is 0 - 1. If not set the default value is 0.7.- Parameters:
gridAlpha
- grid opacity- Returns:
- scrollbar
-
getGridColor
- Returns:
- grid color
-
setGridColor
@StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") public Scrollbar setGridColor(Color gridColor) Sets grid color. If not set the default value is #FFFFFF.- Parameters:
gridColor
- grid color- Returns:
- scrollbar
-
getGridCount
- Returns:
- number of grid lines
-
setGridCount
Sets the number of grid lines. If not set the default value is 0.- Parameters:
gridCount
- number of grid lines- Returns:
- scrollbar
-
getHideResizeGrips
- Returns:
- true if resize grips are hidden when the mouse is away from the scrollbar
-
setHideResizeGrips
Set hideResizeGrips to true if resize grips should be hidden when the mouse is away from the scrollbar. If not set the default value is false.- Parameters:
hideResizeGrips
- hideResizeGrips option- Returns:
- scrollbar
-
getMaximum
- Returns:
- maximum value of
ValueAxis
of scrollbar
-
setMaximum
Sets maximum value ofValueAxis
of scrollbar. Calculated automatically, if not set.- Parameters:
maximum
- maximum value- Returns:
- scrollbar
-
getMinimum
- Returns:
- minimum value of
ValueAxis
of scrollbar
-
setMinimum
Sets minimum value ofValueAxis
of scrollbar. Calculated automatically, if not set.- Parameters:
minimum
- minimum value- Returns:
- scrollbar
-
getResizeEnabled
- Returns:
- true if this property is enabled
-
setResizeEnabled
Set resizeEnabled to false if you want prevent the chart scroll bar to change selection scope. The grip images will not be shown as well. The user would still be able to pan / move selection. If not set the default value is true. If not set the default value is true.- Parameters:
resizeEnabled
- resizeEnabled option- Returns:
- scrollbar
-
getScrollbarHeight
- Returns:
- scrollbar height
-
setScrollbarHeight
Sets height (width, if chart is rotated) of a scrollbar. If not set the default value is 20.- Parameters:
scrollbarHeight
- scrollbar height- Returns:
- scrollbar
-
getScrollDuration
- Returns:
- scroll duration, in seconds
-
setScrollDuration
Sets duration of scrolling, when the user clicks on scrollbar's background, in seconds. Note, updateOnReleaseOnly should be set to false in order animation to happen. If not set the default value is 1.- Parameters:
scrollDuration
- scroll duration, in seconds- Returns:
- scrollbar
-
getSelectedBackgroundAlpha
- Returns:
- selected background opacity
-
setSelectedBackgroundAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setSelectedBackgroundAlpha(Double selectedBackgroundAlpha) Sets selected background opacity. If not set the default value is 1.- Parameters:
selectedBackgroundAlpha
- opacity- Returns:
- scrollbar
-
getSelectedBackgroundColor
- Returns:
- selected background color
-
setSelectedBackgroundColor
@StudioProperty(type=OPTIONS, defaultValue="#EFEFEF") public Scrollbar setSelectedBackgroundColor(Color selectedBackgroundColor) Sets selected background color. If not set the default value is #EFEFEF.- Parameters:
selectedBackgroundColor
- color- Returns:
- scrollbar
-
getSelectedGraphFillAlpha
- Returns:
- selected graph's fill opacity
-
setSelectedGraphFillAlpha
@StudioProperty(defaultValue="1") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setSelectedGraphFillAlpha(Double selectedGraphFillAlpha) Sets selected graph's fill opacity. Value range is 0 - 1. If not set the default value is 1.- Parameters:
selectedGraphFillAlpha
- opacity- Returns:
- scrollbar
-
getSelectedGraphFillColor
- Returns:
- selected graph's fill color.
-
setSelectedGraphFillColor
@StudioProperty(type=OPTIONS, defaultValue="#888888") public Scrollbar setSelectedGraphFillColor(Color selectedGraphFillColor) Sets selected graph's fill color. If not set the default value is #888888.- Parameters:
selectedGraphFillColor
- color.- Returns:
- scrollbar
-
getSelectedGraphLineAlpha
- Returns:
- selected graph's line opacity
-
setSelectedGraphLineAlpha
@StudioProperty(defaultValue="0") @Max(1L) @Min(0L) public @Max(1L) @Min(0L) Scrollbar setSelectedGraphLineAlpha(Double selectedGraphLineAlpha) Sets selected graph's line opacity. Value range is 0 - 1. If not set the default value is 0.- Parameters:
selectedGraphLineAlpha
- opacity- Returns:
- scrollbar
-
getSelectedGraphLineColor
- Returns:
- selected graph's line color
-
setSelectedGraphLineColor
@StudioProperty(type=OPTIONS, defaultValue="#888888") public Scrollbar setSelectedGraphLineColor(Color selectedGraphLineColor) Sets selected graph's line color. If not set the default value is #888888.- Parameters:
selectedGraphLineColor
- color- Returns:
- scrollbar
-
getUpdateOnReleaseOnly
- Returns:
- true if the chart is updated only at the moment when user releases mouse button
-
setUpdateOnReleaseOnly
@StudioProperty(defaultValue="false") public Scrollbar setUpdateOnReleaseOnly(Boolean updateOnReleaseOnly) Set updateOnReleaseOnly to true if the chart should be updated only at the moment when user releases mouse button. If not set the default value is false.- Parameters:
updateOnReleaseOnly
- updateOnReleaseOnly option- Returns:
- scrollbar
-
getGraph
- Returns:
- graph id
-
setGraph
Sets the graph which will be displayed in the scrollbar. Only serial chart's category scrollbar can display a graph.- Parameters:
graph
- graph id- Returns:
- scrollbar
-
getEnabled
- Returns:
- true if scrollbar is enabled
-
setEnabled
Set enabled to false if you don't want scrollbar should be enabled. You can hide/show scrollbar using this property without actually removing it.- Parameters:
enabled
- enabled option- Returns:
- scrollbar
-
getOffset
- Returns:
- distance from plot area to scrollbar, in pixels
-
setOffset
Sets distance from plot area to scrollbar, in pixels. If not set the default value is 0.- Parameters:
offset
- distance, in pixels- Returns:
- scrollbar
-
getDragIcon
- Returns:
- icon file name
-
setDragIcon
@StudioProperty(type=OPTIONS, options={"dragIconRectBig","dragIconRectBigBlack","dragIconRectSmall","dragIconRectSmallBlack","dragIconRoundBig","dragIconRoundBigBlack","dragIconRoundSmall","dragIconRoundSmallBlack"}, defaultValue="dragIconRoundBig") public Scrollbar setDragIcon(String dragIcon) Sets file name of scrollbar drag (resize grip) icon. You can find a set of icons in amcharts/images folder - you can choose from these: dragIconRectBig, dragIconRectBigBlack, dragIconRectSmall, dragIconRectSmallBlack, dragIconRoundBig, dragIconRoundBigBlack, dragIconRoundSmall, dragIconRoundSmallBlack. You can also use your own custom icons. Don't forget to change dragIconWidth and dragIconHeight if you change icons. If not set the default value is "dragIconRoundBig".- Parameters:
dragIcon
- icon file name- Returns:
- scrollbar
-
getIgnoreCustomColors
- Returns:
- true if custom colors is used
-
setIgnoreCustomColors
@StudioProperty(defaultValue="false") public Scrollbar setIgnoreCustomColors(Boolean ignoreCustomColors) Set ignoreCustomColors to true to use scrollbar's graph colors. If you have column type graph in your scrollbar, and this graph has custom colors for one or more columns in data provider, those columns will be colored with this custom color. If not set the default value is false.- Parameters:
ignoreCustomColors
- ignoreCustomColors option- Returns:
- scrollbar
-
getOppositeAxis
- Returns:
- true if oppositeAxis is enabled
-
setOppositeAxis
Set oppositeAxis to false and scrollbar will be placed next to category/value axis. However it won't adjust its position regarding axis labels, so you might need to use offset property to move scrollbar away from labels. By default, scrollbar is in the opposite side of plot area from the axis. If not set the default value is true.- Parameters:
oppositeAxis
- oppositeAxis option- Returns:
- scrollbar
-
getDragCursorDown
- Returns:
- drag cursor down
-
setDragCursorDown
@StudioProperty(defaultValue="cursor: move; cursor: grab; cursor: -moz-grabbing; cursor: -webkit-grabbing;") public Scrollbar setDragCursorDown(String dragCursorDown) Sets drag cursor. Mouse cursor displayed when clicked on selected part of a scrollbar. If not set the default value is "cursor: move; cursor: grab; cursor: -moz-grabbing; cursor: -webkit-grabbing;"- Parameters:
dragCursorDown
- drag cursor down string- Returns:
- scrollbar
-
getDragCursorHover
- Returns:
- drag cursor hover
-
setDragCursorHover
@StudioProperty(defaultValue="cursor: move; cursor: grab; cursor: -moz-grab; cursor: -webkit-grab;") public Scrollbar setDragCursorHover(String dragCursorHover) Sets drag cursor hover. Mouse cursor displayed when hovering over selected part of a scrollbar. If not set the default value is "cursor: move; cursor: grab; cursor: -moz-grab; cursor: -webkit-grab;".- Parameters:
dragCursorHover
- drag cursor hover string- Returns:
- scrollbar
-
getTabIndex
- Returns:
- tab index
-
setTabIndex
Sets tab index to scrollbar. In case you set it to some number, the chart will set focus on grips and draggable area of the scrollbar when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label which is set using accessibleLabel property of ChartScrollbar. When a focus is set user can zoom-in, zoom-out or pan the scrollbar using cursor keys. Note, not all browsers and readers support this.- Parameters:
tabIndex
- tab index- Returns:
- scrollbar
-
getAccessibleLabel
- Returns:
- accessible label string
-
setAccessibleLabel
@StudioProperty(defaultValue="Zoom chart using cursor arrows") public Scrollbar setAccessibleLabel(String accessibleLabel) Sets text which screen readers will read if user rolls-over or sets focus using tab key (this is possible only ifAbstractGraph.tabIndex
is set to some number) on the grips or draggable part of a scrollbar. Text is added as aria-label tag. Not all screen readers and browsers support this. Note, you should set tabIndex to some number in order it would be possible to zoom chart using cursor keys. If not set the default value is "Zoom chart using cursor arrows".- Parameters:
accessibleLabel
- accessible label string- Returns:
- scrollbar
-
getHResizeCursor
- Returns:
- mouse cursor type when user hovers horizontal cursor's resize grips
-
setHResizeCursor
Sets mouse cursor type shown when user hovers horizontal cursor's resize grips. Possible values are: "e-resize", "n-resize", etc. If not set the default value is "ew-resize".- Parameters:
hResizeCursor
- hResizeCursor value
-
getHResizeCursorDown
- Returns:
- CSS value of cursor when mouse is pressed down over horizontal cursor's resize grip
-
setHResizeCursorDown
Sets CSS value of cursor displayed when mouse is pressed down over horizontal cursor's resize grip. For instance, "cursor: all-scroll;".- Parameters:
hResizeCursorDown
- CSS value
-
getHResizeCursorHover
- Returns:
- CSS value of cursor when hovering over horizontal cursor's resize grip
-
setHResizeCursorHover
Sets CSS value of cursor displayed when hovering over horizontal cursor's resize grip.- Parameters:
hResizeCursorHover
- CSS value
-
getVResizeCursor
- Returns:
- mouse cursor type when user hovers vertical cursor's resize grips
-
setVResizeCursor
Sets mouse cursor type shown when user hovers vertical cursor's resize grips. Possible values are: "e-resize", "n-resize", etc. If not set the default value is "ns-resize".- Parameters:
vResizeCursor
- vResizeCursor value
-
getVResizeCursorDown
- Returns:
- CSS value of cursor when mouse is pressed down over vertical cursor's resize grip
-
setVResizeCursorDown
Sets CSS value of cursor displayed when mouse is pressed down over vertical cursor's resize grip. For instance, "cursor: all-scroll;".- Parameters:
vResizeCursorDown
- CSS value
-
getVResizeCursorHover
- Returns:
- CSS value of cursor when hovering over vertical cursor's resize grip
-
setVResizeCursorHover
Sets CSS value of cursor displayed when hovering over vertical cursor's resize grip.- Parameters:
vResizeCursorHover
- CSS value
-