I saw the documentation of the Highcharts and couldn't find any example that add only one clickable point to the chart. There is no point or all of them are clickable.
Is it posible to bind only for one point to click ?
Thanks in advance!
This is not so obvious. You know that you can pass the data to the chart as an array of Point
objects, like this:
series: [{
data: [{
name: 'Point 1',
x: 0,
y: 1
}, {
name: 'Point 2',
x: 1,
y: 5
}]
}]
But you may not know that any Point
can have its own events. So you can do something like this:
series: [{
data: [{
name: 'Point 1',
x: 0,
y: 1,
events: {
click: function () {
alert ('Click!');
}
}
}]
}]
And there's a jsFiddle demonstration of above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With