ChartCursor
Type class
ChartCursor is a class which displays a cursor which follows the mouse. In case of Serial chart it also shows value and category balloons.
Example of how cursor is added to the chart:
var chart = new AmCharts.AmSerialChart();
var chartCursor = new AmCharts.ChartCursor();
chart.addChartCursor(chartCursor);```
Sources
This information about ChartCursor is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.
Inheritance
ChartCursor does not extend any other symbol.
ChartCursor is not extended by any other symbol.
Properties
bulletsEnabledType
booleanDefaultfalseSpecifies if bullet for each graph will follow the cursor.
bulletSizeType
numberDefault8Size of bullets, following the cursor.
categoryBalloonAlphaType
numberDefault1Opacity of the category balloon.
categoryBalloonColorType
stringDefaultColor of the category balloon. cursorColor is used if not set.
categoryBalloonDateFormatType
stringDefaultMMM DD, YYYYCategory balloon date format (used only if category axis parses dates). Check this page for instructions on how to format dates.
categoryBalloonEnabledType
booleanDefaulttrueSpecifies whether category balloon is enabled.
categoryBalloonFunctionType
FunctionAllows formatting any category balloon text you want. categoryBalloonFunction should return a string which will be displayed in a balloon. When categoryBalloonFunction is called, category value (or date) is passed as an argument.
colorType
stringDefault#FFFFFFText color.
cursorAlphaType
numberDefault1Opacity of the cursor line.
cursorColorType
stringDefault#CC0000Color of the cursor line.
cursorPositionType
stringDefaultSpecifies where the cursor line should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). If you want the cursor to follow mouse and not to glue to the nearest data point, set "mouse" here. Possible values are: "start", "middle", "mouse".
enabledType
booleanDefaulttrueSpecifies whether cursor is enabled.
oneBalloonOnlyType
booleanDefaultfalseIf this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming.
panType
booleanDefaultfalseIf this is set to true, the user will be able to pan the chart (Serial only) instead of zooming.
selectionAlphaType
numberDefaultOpacity of the selection.
selectWithoutZoomingType
booleanDefaultfalseSpecifies if cursor should only mark selected area but not zoom-in after user releases mouse button.
valueBalloonsEnabledType
booleanDefaulttrueSpecifies whether value balloons are enabled. In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet.
zoomableType
booleanDefaulttrueSpecifies if the user can zoom-in the chart. If pan is set to true, zoomable is switched to false automatically.
zoomingType
booleanDefaultIndicates if currently user is selecting some chart area to zoom-in.
Methods
addListener()Returns
voidAdds event listener to the object.
type - string like 'changed' (should be listed in 'events' section of this class or classes which extend this class). handler - function which is called when event happens
hideCursor()Returns
voidHides cursor.
removeListener()Returns
voidRemoves event listener from the object.
showCursorAt()Returns
voidYou can force cursor to appear at specified cateogry or date.
Events
changedParam { type:
"changed", target:ChartCursor} &{type:"changed", index:Number, zooming:Boolean, mostCloseGraph:AmGraph, chart:AmChart }Dispatched when cursor position is changed. "index" is a series index over which chart cursors currently is. "zooming" specifies if user is currently zooming (is selecting) the chart. mostCloseGraph property is set only when oneBalloonOnly is set to true.
onHideCursorParam { type:
"onHideCursor", target:ChartCursor} &{type:"onHideCursor", chart:AmChart}Dispatched when cursor is hidden.
selectedParam { type:
"selected", target:ChartCursor} &{type:"changed", index:Number, zooming:Boolean, chart:AmChart}Dispatched if selectWithoutZooming is set to true and when user selects some period. start and end are indices or time stamp (when categoryAxis.parseDates is true) of selection start/end.
zoomedParam { type:
"zoomed", target:ChartCursor} &{type:"changed", index:Number, zooming:Boolean, chart:AmChart}Dispatched when user zooms to some period. start and end are indices or time stamp (when categoryAxis.parseDates is true) of selection start/end.