score:7
Accepted answer
You need to set the event
on the plotOptions
property. Here's an example taken from the Highcharts
API documentation:
$(function () {
var $reporting = $('#reporting');
$('#container').highcharts({
title: {
text: 'Mouse events demo'
},
subtitle: {
text: 'On point mouse over or mouse out, the values should be reported in top left'
},
plotOptions: {
series: {
point: {
events: {
mouseOver: function () {
var chart = this.series.chart;
if (!chart.lbl) {
chart.lbl = chart.renderer.label('')
.attr({
padding: 10,
r: 10,
fill: Highcharts.getOptions().colors[1]
})
.css({
color: '#FFFFFF'
})
.add();
}
chart.lbl
.show()
.attr({
text: 'x: ' + this.x + ', y: ' + this.y
});
}
}
},
events: {
mouseOut: function () {
if (this.chart.lbl) {
this.chart.lbl.hide();
}
}
}
}
},
tooltip: {
enabled: false
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
score:1
You can also use chart.hoverPoint
if trying to find out the currently moused over point from outside the mouseOver
event. However this is not on the documentation, which likely means it can change in the future.
Source: stackoverflow.com
Related Query
- How do I get the value of a highcharts graph point on mouseover?
- How to get Highcharts X-Axis Categories starting at the left most point
- How to get the highlighted point from shared tooltip formatter, Highcharts
- Highcharts Bubble Chart - How to get the size of the point
- Highcharts - How can I get the nearest point on click event
- How to get the axis value with respect to the cross hair in highcharts
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- How to Increase minimum point value and the color of series in advanced accessible charts in Highcharts by making it traverse
- How do you get the mouse hovered label value with the highcharts custom event plugin?
- How to get highcharts dates in the x axis?
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How can I get the max value of a y axis at highcharts?
- Highcharts - How to get a value of a stack in a series?
- how to get chart object inside a point event function in Highcharts
- How do I set highcharts line graph point colors to an array of colors?
- *Highcharts* How to get the min and max value of the zoom box
- Highcharts How to get decimal point values on y-axis with big numbers
- Get name of clicked point in Highcharts when the point has drilldown
- Highcharts: How to provide a custom stack label in highcharts bar graph from within the stackLabel formatter?
- How to change area graph color above certain value in Highcharts
- How to get next point in Highcharts tooltip
- How to get the Div id of charts in highcharts on click of it in angular 6
- How to add point to the beginning of series, Highcharts
- how to get the axis value when I click on a cursor in highstock(high charts)?
- How to remove the value and number labels from Highcharts angular gauge
- How do I get my highcharts to reduce in size when the window is resized down
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- how to display 2 same highcharts without duplicate the code
- how can i add in highcharts a different dashStyle just for a part of the graph
More Query from same tag
- Adding a string to highcharts tooltip based on a separate data series
- Include hidden series in exported CSV using Highcharts v8.0
- How to access different contexts of 'this' in HighCharts callback (Angular / Typescript)
- highcharts-react-official, how to implement setOptions from the official documentation, in react?
- highcharts endOnTick option showing unspecified value on axis
- Highcharts donut hover all area
- median and standard deviation chart using highcharts
- Highchart plugin creating different Y-axis scale on different browsers
- Highcharts parsed drilldown not showing on page but does in console
- Highcharts change symbol and hover text of individual points Line Chart
- Highcharts.stockChart is not a function
- Tick Interval for 5 days
- Highcharts pie/variablepie align multilines label on plotedge
- BIRT: Custom Highcharts Event Handlers
- Sync ticks on multiple independent axis
- Angular cannot using Highcharts X-range series
- Creating a drilldown chart with Highcharts that contain double(multiple) columns for each column (see example for better explanation)
- Highcharts with JQuery mobile Black display
- How draw plot lines on a solid gauge charts
- how to show data label only on drilldown pie?
- highcharts: stop chart from trapping mouse events, or capture mouse click on the ENTIRE chart
- Highcharts - How to split up multiple charts in Rails 3
- Highchart bullet map plotBackground color always visible
- Build charts from polling JSON data
- Highstocks - Place a line between columns when using datetime axis
- highcharts column chart json data is not accepted
- Adding a link to each stacked bar chart item
- Bar color not being set correctly in highcharts?
- Display real time scale on xAxis
- Getting {% load chartit %} on my browser. Charts are not loading using chartit