score:5
Accepted answer
If you want to attach additional data to points in a series you can initialize the points that need additional data as objects instead of arrays/ints. For example, with your code you could do:
series: [{
name: 'Song Plays',
data: [
{x:'song_name1', y:123, songid:'song_id_1'},
{x:'song_name2', y:234, songid:'song_id_2'}
]
}]
You can then get it from the point on click as event.point.songid
. See this JSFiddle demo using point click and tooltip.
Note that in many cases x
in the object will not be required. It is often automatic and sequential.
score:2
You can try
alert(event.point.series.userOptions.data[event.point.x][2])
Updated fiddle: http://jsfiddle.net/y4a2end3/2/
Or this:
alert(event.point.series.userOptions.data[event.point.series.data.indexOf(event.point)][2]);
Source: stackoverflow.com
Related Query
- How to pass custom data into Highcharts graph click event
- Angular 8 highcharts How to pass custom data to drilldown event in Highcharts
- Yii2 How to pass php array data into highcharts
- Highcharts how to pass data from server into chart
- How to load custom JSON data into Highcharts mapbubble?
- Highcharts : Chart with drilldown how to obtain click event of drill up button
- How to pass json data to highcharts series?
- highcharts how to catch and insert logic in click reset zoom button event
- How to get multiple data series into Highcharts
- Highcharts: How to provide a custom stack label in highcharts bar graph from within the stackLabel formatter?
- HighCharts: How to Determine on Click Event what Data Grouping the Chart is Currently In?
- How to attach click event function in Highcharts
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- How to add series after click event in HighCharts
- Click event and two way data binding in HighCharts using AngularJS
- How to input plot data into highcharts with rails
- How to align Highcharts datetime x-axis with data I pass to it?
- Dynamically set click event on bar from highcharts graph
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- How can I pass values from Highcharts event callbacks (click, mouseOver, mouseOut) back to React component member function?
- Highcharts custom events plugin right click event not firing
- How do I attach a click event handler to the whole HighCharts Gauge control?
- How can I make React Native in Android aware of a click event in a tooltip in a Highcharts chart?
- Highcharts access drilldown data from event click
- Pass data to click event callback in Highstock chart with more then 1000 entries
- Highcharts - How can I get the nearest point on click event
- How can I use data.table or data.csv and extra data for click event handling
- how to continue the graph line when missing series of data in middle of highcharts
- Angular 11 - How to import array data into highcharts
- highcharts group series click event to get all data in catagory
More Query from same tag
- Highchart show results without comma for individual line
- How to change the font family of Highchart to Bootstrap css default font family
- HighCharts reading from CSV basic example
- Use ajax to draw graph dynamically using Highcharts
- How to make buttons filter different data based on a category they select in Highcharts heatmap?
- web page is hanging while loading from DB and large data not showing on charts in asp.net mvc5
- Can I use different if-conditions in Highstock-code?
- Highcharts: Not plotting correctly with Y-Axis label formatter
- How to change DateTime format on Highcharts?
- Show Indicator at last point on Highchart spline chart
- Dynamic Input to Highcharts via HTML input field?
- Can't show the array to charts
- HighCharts does not add a new points
- Uncaught TypeError: Object (JS Function) has no method 'apply'
- My highchart not showing the correct time on the x-axis
- How to get index of a point in Highcharts?
- Updating Chart with live Values, adding second line
- Highchart gauge not displaying min/max value in Vue.js
- Highcharts: Fade plotLines based on hover on marker
- Remove Highchart series in shiny
- Adjust pane position in solid gauge
- Highcharts: Looping JSON into Series Data
- Highcharts Stacked Column chart from JSON not charting correct values
- Highcharts get additional info in tool tip form JSON object
- Highcharts dynamic height with table layout
- highcharts not given the right xAxis labels on page load
- Highcharts barchart - legend is only hiding first and last series, others stay visible on X-axis
- R Shiny: setExtremes in Highcharts (rCharts) on page load
- Multiple Gauge Chart
- Highcharts change symbol and hover text of individual points Line Chart