score:29
Accepted answer
you want the event handling on the point config, not the series. each wedge is a point in a single series:
var data = [{ name: 'one', y: 10, id: 0 },{ name: 'two', y: 10, id: 1 }];
// some other code here...
series:[
{
"data": data,
type: 'pie',
animation: false,
point:{
events:{
click: function (event) {
alert(this.x + " " + this.y);
}
}
}
}
],
fiddle here.
full running code:
var chart;
point = null;
$(document).ready(function () {
var data = [{ name: 'one', y: 10, id: 0 },{ name: 'two', y: 10, id: 1 }];
chart = new highcharts.chart(
{
series:[
{
"data": data,
type: 'pie',
animation: false,
point:{
events:{
click: function (event) {
alert(this.id);
}
}
}
}
],
"chart":{
"renderto":"container"
},
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="width: 320px; height: 200px"></div>
Source: stackoverflow.com
Related Query
- Highcharts Pie charts get the selected pie id
- How to get the Div id of charts in highcharts on click of it in angular 6
- Why code of Horizonal line(y-axis) on a single in Highcharts get applied to all other charts integrated with Webdatarocks
- Highcharts - How can I get the name to display in the pie wedges?
- Highcharts Align pie charts to the Left
- Verify if Pie in Highcharts Pie charts is selected or deselected
- How to use Highcharts getSelectedPoints to get comma separated string of selected pie slices
- How to get highcharts dates in the x axis?
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- HighCharts - Make the pie chart 100% of the div
- Highcharts - Hidden charts don't get re-size properly
- How to hide labels in the highcharts in the pie
- How to get Highcharts X-Axis Categories starting at the left most point
- Highcharts Error #16: charts not showing on the same page
- How can I remove the white border from HighCharts pie chart?
- How do I get the value of a highcharts graph point on mouseover?
- Enable or disable data labels shown in pie charts in Highcharts on click of a button
- Tooltips getting cutoff in pie charts in highcharts
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- Highcharts pie charts can have url links
- Hiding label guidelines on Highcharts pie charts
- How do I style the series labels on a Highcharts pie chart?
- Get name of clicked point in Highcharts when the point has drilldown
- Highcharts (Highstock) how to manually set the navigator selected range
- Get x-axis label into the first colomn of the table - highcharts
- DotNet HighCharts , Populates a pie with the result of a query
- drilldown maps and funnell charts on the same page using highcharts
- Highcharts - Getting a 3d effect with selected pie chart slices
- Highcharts - Rotate pie chart aligning the clicked section to a fixed point (180°)
- Get the currently selected range from RangeSelector in Highstock
More Query from same tag
- Set yAxis background color in Highstock
- How to add an icon beside all the series in an legend
- Highcharts bar grouping while maintaining transparent overlay?
- Highcharts Compare Date Ranges Bar Chart
- How do I get this text inside of this HTML using Selenium Webdriver?
- Never want to hide tooltip on highcharts
- using a few data columns to plot chart and some to show on tooltip highcharts
- Highcharts Pie charts get the selected pie id
- Highcharts gradient fill how to?
- Change marker line color in highstocks
- How to add the categories inside the slice and show the absolute number instead of the relative number
- Any chart library for funnel chart instead of highchart?
- highchart remove first point
- How to use a variable as js code?
- Gradient fill for react-highcharts' line chart
- Highcharts: cutom tooltip (useHTML: true) z-index issue over resetZoomButton
- How to create overlapping bar charts in angular js?
- Highcharts - Export server not generating image
- In Highchart, use JSON file instead of csvURL
- How to Change space between series data colums in highcharts?
- highcharts - custom legend width
- Make a choropleth from a non-highmap-collection map
- Highstock and null values
- Category is not updating for drildown bar chart
- HighCharts - 2nd yAxis graphs not scaling correctly
- ( Highcharts ) How to make dataLabels disappear if there is, a higher column?
- read the json file to output to an highcharts
- Highcharts "Top 5 users" bar
- Get name of clicked point in Highcharts when the point has drilldown
- How to use styled from react-emotion with HighchartsReact?