Skip to content

Instantly share code, notes, and snippets.

@kw0006667
Last active March 16, 2020 00:04
Show Gist options
  • Save kw0006667/d574b5c699d84c6978fda04b723da924 to your computer and use it in GitHub Desktop.
Save kw0006667/d574b5c699d84c6978fda04b723da924 to your computer and use it in GitHub Desktop.
Select point by calling select() method in Highcharts
var searchText = 'US';
var chart = new Highcharts.chart('container', {
series: [{
name: 'Asia',
data: [{
name: 'Taiwan',
value: 87
}, {
name: 'Japan',
value: 86
}]
}, {
name: 'Europe',
data: [{
name: 'Italy',
value: 66
}, {
name: 'Spain',
value: 72
}]
}, {
name: 'America',
data: [{
name: 'US',
value: 78
}, {
name: 'Canada',
value: 81
}]
}]
});
chart.series.forEach(serie => {
serie.points.forEach(point => {
if (point.name === searchText) {
point.select();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment