Create a scrollbar for AmSerialChart and AmXYChart charts.

Example

var chart = AmCharts.makeChart("chartdiv",{
  ...
  "pathToImages": "http://cdn.amcharts.com/lib/3/images/", // required for grips
  "chartScrollbar": {
    "updateOnReleaseOnly": true
  }
});

Properties

PropertyTypeDefaultDescription
accessibleLabelString Zoom chart using cursor arrowsText which screen readers will read if user rolls-over or sets focus using tab key (this is possible only if tabIndex property of AmGraph is set to some number) on the grips or draggable part of a scrollbar. Text is added as aria-label tag. Note - 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.
autoGridCountBooleanfalseSpecifies whether number of gridCount is specified automatically, according to the axis size.
backgroundAlphaNumber1Background opacity.
backgroundColorColor#D4D4D4Background color of the scrollbar.
categoryAxisCategoryAxisRead-only. Category axis of the scrollbar.
colorColor#FFFFFFText color.
dragCursorDownStringcursor: move; cursor: grab; cursor: -moz-grabbing; cursor: -webkit-grabbing;Mouse cursor displayed when clicked on selected part of a scrollbar.
dragCursorHoverStringcursor: move; cursor: grab; cursor: -moz-grab; cursor: -webkit-grab;Mouse cursor displayed when hovering over selected part of a scrollbar.
dragIconStringdragIconRoundBigFile 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.
dragIconHeightNumber35Height 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.
dragIconWidthNumber35Width 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.
enabledBooleantrueSpecifies if scrollbar is enabled. You can hide/show scrollbar using this property without actually removing it.
graphAmGraphSpecifies which graph will be displayed in the scrollbar. Only Serial chart's category scrollbar can display a graph.
graphFillAlphaNumber1Graph fill opacity. Value range is 0 - 1.
graphFillColorColor#BBBBBBGraph fill color.
graphLineAlphaNumber0Graph line opacity. Value range is 0 - 1.
graphLineColorColor#BBBBBBGraph line color.
graphTypeStringby 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
gridAlphaNumber0.7Grid opacity. Value range is 0 - 1.
gridColorColor#FFFFFFGrid color.
gridCountNumber0The number of grid lines.
hideResizeGripsBooleanfalseSpecifies whether resize grips are hidden when mouse is away from the scrollbar.
hResizeCursorStringew-resizeMouse cursor type shown when user hovers horizontal cursor's resize grips.
hResizeCursorDownStringCSS value of cursor displayed when mouse is pressed down over horizontal cursor's resize grip.
hResizeCursorHoverStringCSS value of cursor displayed when hovering over horizontal cursor's resize grip.
ignoreCustomColorsBooleanfalseIf 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. However you might not want this in some cases. Set this property to true to use scrollbar's graph colors.
maximumNumberMaximum value of ValueAxis of ChartScrollbar. Calculated automatically, if not set.
minimumNumberMinimum value of ValueAxis of ChartScrollbar. Calculated automatically, if not set.
offsetNumber0Distance from plot area to scrollbar, in pixels.
oppositeAxisBooleantrueBy default, scrollbar is in the opsite side of plot area from the axis. If you set this property to false, scrollbar will be placed next to category/value axis. However it won't adjust it's position regarding axis labels, so you might need to use offset property to move scrollbar away from labels.
resizeEnabledBooleantrueIf set to false it will 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.
scrollbarHeightNumber20Height (width, if chart is rotated) of a scrollbar.
scrollDurationNumber1Duration of scrolling, when the user clicks on scrollbar's background, in seconds. Note, updateOnReleaseOnly should be set to false in order animation to happen.
selectedBackgroundAlphaNumber1Selected backround opacity.
selectedBackgroundColorColor#EFEFEFSelected background color.
selectedGraphFillAlphaNumber1Selected graph's fill opacity. Value range is 0 - 1.
selectedGraphFillColorColor#888888Selected graph's fill color.
selectedGraphLineAlphaNumber0Selected graph's line opacity. Value range is 0 - 1.
selectedGraphLineColorColor#888888Selected graph's line color.
tabIndexNumberIn 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.
updateOnReleaseOnlyBooleanfalseSpecifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when user releases mouse button.
vResizeCursorStringns-resizeMouse cursor type shown when user hovers vertical cursor's resize grips.
vResizeCursorDownStringCSS value of cursor displayed when mouse is pressed down over vertical cursor's resize grip.
vResizeCursorHoverStringCSS value of cursor displayed when hovering over vertical cursor's resize grip.

Methods

ChartScrollbar class does not have any methods.

Events

ChartScrollbar class does not have any events.