showAtX(Mixed xValue [, dataSeriesIndex = 0])
Shows toolTip at the specified x value of a dataSeries.
Parameters:
xValue: x value for which toolTip needs to be shown.
dataSeriesIndex: Index of dataseries for which toolTip needs to be shown. By default, dataSeriesIndex is set to 0. i.e. in case of multi-series chart, toolTip for first dataSeries will be shown. This parameter is ignored if “shared” property of toolTip is set to true – in which case toolTip content includes data for all the series.
Returns:
Boolean: Returns true if the operation was successful. Else returns false.
Example:
chart.toolTip.showAtX(10,0);
Note:
- Chart should be rendered before you can use showAtX method.
- showAtX can be used to sync toolTip across multiple charts in a page.
var chart = new CanvasJS.Chart("container",
{
.
.
toolTip: {
// toolTip properties
},
.
.
});
chart.render();
chart.toolTip.showAtX(10,0);
Syncing ToolTip
Below is an example showing synchronizing toolTip across multiple charts.
Try it Yourself by Editing the Code below.