score:39
if you want to add an event listener after the chart is already created, the documentation provides some insight regarding extending highcharts:
events can be added to the instance through framework event binding. if your framework is jquery, you can for example run
$(chart).bind('load', somefunction);
there is even some mention in the "hooking up to chart.init" section (on the same page) as to how you might bind an event after the chart has rendered, but it is a more invasive solution. i've adapted the code sample below with some modifications:
// general, global event listener
var globalcallback = function (chart) {
// specific event listener
highcharts.addevent(chart.container, 'click', function (e) {
e = chart.pointer.normalize();
console.log('clicked chart at ' + e.chartx + ', ' + e.charty );
});
// specific event listener
highcharts.addevent(chart.xaxis[0], 'aftersetextremes', function (e) {
console.log('set extremes to ' + e.min + ', ' + e.max);
});
}
// add `globalcallback` to the list of highcharts callbacks
highcharts.chart.prototype.callbacks.push(globalcallback);
you can also take a look at their example jsfiddle for this scenario.
Source: stackoverflow.com
Related Query
- How do I add an event listener to a Highcharts object *AFTER* I've created it
- How to add series after click event in HighCharts
- how to get chart object inside a point event function in Highcharts
- How to add new points to highcharts after plotting the first 'n' points?
- How do i add mouse wheel code in Angular2 highcharts in typescript
- How to add different click events on each pie of a pie chart created by highcharts usin jquery
- how to add onclick event handler inside highcharts tooltip
- HighCharts : How to add click event on colorAxis in heatmap
- Link two series object in Highcharts and add event
- How to access React hook state in Highcharts event listener
- Highcharts how to add treemap upon click event on line chart?
- how to add copyright symbol in a highcharts title?
- Change Highcharts tooltip formatter from chart Object , after chart is rendered
- Highcharts : Chart with drilldown how to obtain click event of drill up button
- highcharts how to catch and insert logic in click reset zoom button event
- In high chart how to add event for label click
- How to add image in Highcharts Title and subtitle
- How to pass custom data into Highcharts graph click event
- How to add Highcharts on UIWebView in iOS?
- how to add annotation text to a Highcharts chart?
- How to add space between chart and axis in highcharts
- How to add secondary y-axis to highcharts
- How to add a label above each bar in HighCharts
- How to add an item to Highcharts legend?
- Add onclick event on chart made with the highcharts library
- Add highcharts plotband after render in R shiny/rcharts
- How to hide Axes Crosshairs by onclick event in Highcharts
- How to add background colors to category groupings in Highcharts
- HighCharts : How to add or remove "chart context menu" from chart container?
- How to add point to the beginning of series, Highcharts
More Query from same tag
- Highcharts highlight single point on line
- ReactJs HighCharts toggle table and chart not updating
- javascript highcharts jQuery issue
- Create Phantomjs export server to convert highchart to image base64 string
- Highcharts - Display only year in x axis and stop auto formatting
- Highchart multi axes labels not showing
- add border color and width to 3d bar highcharts
- How to add vertical (and horizontal) line in highcharts scatter plot
- Drawing a simple graph using projected lines
- The opposite X aXis series is not showed in the navigator
- How to make mathematical chart with HighCharts?
- Highcharts Grouped Column Chart with Multiple Groups?
- Highstocks not showing stock tools
- Setting Min and Max values for more than two Highchart Solid Gauges using function
- R shiny Highcharts tooltip: adding average as extra variable
- Facing issues with Highcarts.Chart
- all bar should be of same height . data part should be coloured and rest should be grayed
- Setting options.rangeSelector.selected to 0 does not set zoom to correct level in highstock
- Highcharts markers positioning errors in IE8
- Highcharts: duplicate datalabel text on export
- Highcharts: Can I export to the user an Excel or CSV of the raw data driving the chart?
- Update Highcharts tooltip with onchange
- How To Use Epoch Time With Highcharts Series Data?
- How to set the background of clicked or selected label on y axis gantt chart Highcharts?
- Highstocks tooltip Remove the phrase "Week From Monday"
- Populate Highcharts X-Axis With Dates Given a From And To Date
- HighCharts Drag points saving with angularJs
- how to place the chart in the centre while using django-chartit?
- Yii HighCharts not displaying from $vars but display when hardcoded
- Export Highcharts to PDF (using javascript and local server - no internet connection)