Class Scrollbar

All Implemented Interfaces:
Serializable

public class Scrollbar extends AbstractChartObject
Creates a scrollbar for SerialChartModelImpl and XYChartModelImpl charts.
See documentation for properties of ChartScrollbar JS Object.
http://docs.amcharts.com/3/javascriptcharts/ChartScrollbar
See Also:
  • Constructor Details

    • Scrollbar

      public Scrollbar()
  • Method Details

    • getAutoGridCount

      public Boolean getAutoGridCount()
      Returns:
      true if a number of gridCount is specified automatically, according to the axis size
    • setAutoGridCount

      @StudioProperty(defaultValue="false") public Scrollbar setAutoGridCount(Boolean autoGridCount)
      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

      public Double 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

      public Color 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

      public Color getColor()
      Returns:
      text color
    • setColor

      @StudioProperty(type=OPTIONS, defaultValue="#FFFFFF") public Scrollbar setColor(Color color)
      Sets text color. If not set the default value is #FFFFFF.
      Parameters:
      color - text color
      Returns:
      scrollbar
    • getDragIconHeight

      public Integer getDragIconHeight()
      Returns:
      drag icon height
    • setDragIconHeight

      @StudioProperty(defaultValue="35") public Scrollbar setDragIconHeight(Integer dragIconHeight)
      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

      public Integer getDragIconWidth()
      Returns:
      drag icon width
    • setDragIconWidth

      @StudioProperty(defaultValue="35") public Scrollbar setDragIconWidth(Integer dragIconWidth)
      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

      public Double 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

      public Color 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

      public Double 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

      public Color 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

      public GraphType getGraphType()
      Returns:
      graph type
    • setGraphType

      @StudioProperty(type=ENUMERATION) public Scrollbar setGraphType(GraphType graphType)
      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

      public Double 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

      public Color 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

      public Integer getGridCount()
      Returns:
      number of grid lines
    • setGridCount

      @StudioProperty(defaultValue="0") public Scrollbar setGridCount(Integer gridCount)
      Sets the number of grid lines. If not set the default value is 0.
      Parameters:
      gridCount - number of grid lines
      Returns:
      scrollbar
    • getHideResizeGrips

      public Boolean getHideResizeGrips()
      Returns:
      true if resize grips are hidden when the mouse is away from the scrollbar
    • setHideResizeGrips

      @StudioProperty(defaultValue="false") public Scrollbar setHideResizeGrips(Boolean hideResizeGrips)
      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

      public Double getMaximum()
      Returns:
      maximum value of ValueAxis of scrollbar
    • setMaximum

      @StudioProperty public Scrollbar setMaximum(Double maximum)
      Sets maximum value of ValueAxis of scrollbar. Calculated automatically, if not set.
      Parameters:
      maximum - maximum value
      Returns:
      scrollbar
    • getMinimum

      public Double getMinimum()
      Returns:
      minimum value of ValueAxis of scrollbar
    • setMinimum

      @StudioProperty public Scrollbar setMinimum(Double minimum)
      Sets minimum value of ValueAxis of scrollbar. Calculated automatically, if not set.
      Parameters:
      minimum - minimum value
      Returns:
      scrollbar
    • getResizeEnabled

      public Boolean getResizeEnabled()
      Returns:
      true if this property is enabled
    • setResizeEnabled

      @StudioProperty(defaultValue="true") public Scrollbar setResizeEnabled(Boolean resizeEnabled)
      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

      public Integer getScrollbarHeight()
      Returns:
      scrollbar height
    • setScrollbarHeight

      @StudioProperty(defaultValue="20") public Scrollbar setScrollbarHeight(Integer scrollbarHeight)
      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

      public Double getScrollDuration()
      Returns:
      scroll duration, in seconds
    • setScrollDuration

      @StudioProperty(defaultValue="1") public Scrollbar setScrollDuration(Double scrollDuration)
      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

      public Double 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

      public Color 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

      public Double 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

      public Color 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

      public Double 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

      public Color 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

      public Boolean 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

      public String getGraph()
      Returns:
      graph id
    • setGraph

      public Scrollbar setGraph(String graph)
      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

      public Boolean getEnabled()
      Returns:
      true if scrollbar is enabled
    • setEnabled

      @StudioProperty public Scrollbar setEnabled(Boolean enabled)
      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

      public Integer getOffset()
      Returns:
      distance from plot area to scrollbar, in pixels
    • setOffset

      @StudioProperty(defaultValue="0") public Scrollbar setOffset(Integer offset)
      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

      public String 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

      public Boolean 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

      public Boolean getOppositeAxis()
      Returns:
      true if oppositeAxis is enabled
    • setOppositeAxis

      @StudioProperty(defaultValue="true") public Scrollbar setOppositeAxis(Boolean oppositeAxis)
      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

      public String 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

      public String 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

      public Integer getTabIndex()
      Returns:
      tab index
    • setTabIndex

      @StudioProperty public Scrollbar setTabIndex(Integer tabIndex)
      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

      public String 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 if AbstractGraph.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

      public String getHResizeCursor()
      Returns:
      mouse cursor type when user hovers horizontal cursor's resize grips
    • setHResizeCursor

      @StudioProperty(defaultValue="ew-resize") public void setHResizeCursor(String hResizeCursor)
      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

      public String getHResizeCursorDown()
      Returns:
      CSS value of cursor when mouse is pressed down over horizontal cursor's resize grip
    • setHResizeCursorDown

      @StudioProperty public void setHResizeCursorDown(String hResizeCursorDown)
      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

      public String getHResizeCursorHover()
      Returns:
      CSS value of cursor when hovering over horizontal cursor's resize grip
    • setHResizeCursorHover

      @StudioProperty public void setHResizeCursorHover(String hResizeCursorHover)
      Sets CSS value of cursor displayed when hovering over horizontal cursor's resize grip.
      Parameters:
      hResizeCursorHover - CSS value
    • getVResizeCursor

      public String getVResizeCursor()
      Returns:
      mouse cursor type when user hovers vertical cursor's resize grips
    • setVResizeCursor

      @StudioProperty(defaultValue="ns-resize") public void setVResizeCursor(String vResizeCursor)
      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

      public String getVResizeCursorDown()
      Returns:
      CSS value of cursor when mouse is pressed down over vertical cursor's resize grip
    • setVResizeCursorDown

      @StudioProperty public void setVResizeCursorDown(String vResizeCursorDown)
      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

      public String getVResizeCursorHover()
      Returns:
      CSS value of cursor when hovering over vertical cursor's resize grip
    • setVResizeCursorHover

      @StudioProperty public void setVResizeCursorHover(String vResizeCursorHover)
      Sets CSS value of cursor displayed when hovering over vertical cursor's resize grip.
      Parameters:
      vResizeCursorHover - CSS value