Last active
March 16, 2020 00:04
-
-
Save kw0006667/d574b5c699d84c6978fda04b723da924 to your computer and use it in GitHub Desktop.
Select point by calling select() method in Highcharts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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