score:2
First, I would never create a function like S
. If you find yourself creating function with arguments like arg1, arg2, arg3, arg4
then something is wrong with your design. Ignoring that for a second and answering your question.
Highcharts allows you to setup a click
event handler for many different components on the plot. You set up these handlers in your plotOptions for that specific component. For instance, if you want to handle a click event on a scatter plot point, you set a handler like this:
plotOptions: {
series: {
point: {
events: {
click: function() {
// look at the variable this
}
}
}
}
},
Inside the function()
the this
variable is the item that was clicked on. In the case of a scatter plot point, it is the point object. In this function, you are free to call your s
function passing whatever data you want to it queried from the this
.
Next, if you are creating the close button as a highcharts context button, you would set a click handler on that component. For that handler the this
is the chart object.
Using this approach you can create a click handler for every component you care about. From those handlers, you call you s
function.
Source: stackoverflow.com
Related Query
- Highcharts - Scatter plot: How to send information from clicks to a function with information about the click as parameters
- Highcharts - How to make a scatter plot with multiple series from HTML table
- Parsing JSON for use with Highcharts using jquery .parseJSON or JSON.parse: how to remove quotes from function calls for formatters?
- from csv to scatter plot with HighCharts
- How to prevent highcharts from shortening labels with ellipsis
- Highcharts scatter plot with lots of data points running really slow
- Highcharts scatter plot with variable line width
- How to populate a Highcharts axis with string formatted data from a PHP array
- HighCharts scatter plot with Datetime on X Axis not plotting values correctly
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- Tooltip in chart with line- and scatter plot in highcharts 3.0.7
- How can I make a graph with highcharts from csv file?
- How to input plot data into highcharts with rails
- How to get a cubical plot using highcharts 3D scatter chart?
- Highcharts Scatter Plot - How to Fix Overlapping Data Labels?
- How to deal in Highcharts with special characters from CSV file?
- How to suppress items with NULL value from HighCharts legend
- Possible to use Highcharts Scatter Plot with categories?
- How to send json to highcharts from php
- How to add an extra label on a scatter plot point in Highcharts Javascript library?
- Plot Highcharts data from past 30 days with Ruby on Rails
- How to create two plot areas with highcharts
- How to add vertical (and horizontal) line in highcharts scatter plot
- How to use highcharts in reactjs with fetched data from API
- How to hide series name from tooltip in Highcharts scatter plots for linear regression
- How to call Highcharts tooltip formatter function from outside the config object?
- HighCharts column chart populated with series data from a function
- Highcharts how to make legends as data labels on scatter plot
- How can I specify custom end markers in a scatter series with Highcharts 9?
- HighCharts activity gauge populated with series data from a function
More Query from same tag
- Multiple plotLines using options in HighCharts
- adding font to highcharts editor
- Average values based on date from json to array of arrays
- Shows a single chart on Highcharts
- Highcharts datetime starting on wrong day
- Nested json in Highcharts Stacked
- Highcharts - how to get consistent mouseover and mouseout events for columns?
- Highcharts event on animation complete?
- Highstock marker specific option ignored
- tickInterval & categories. Only first category shows
- Highcharts - Possible to change the text zoom to other wording?
- Swap Y Axis in Highchart
- How do I properly format HighStock x-axis ticks based on unix timestamps?
- highcharts chart height apart from legend
- Can't get events to work on images with Highmaps
- Highcharts : axis with multiple colour
- Upgrading to v3.0
- How to change tooltip of a column chart programmatically in highchart
- Highchart Funnel Chart not showing
- If a point is clicked then add a marker in highcharts
- Tooltip stacked column with 3 values array
- Highcharts - tooltip headerformat for 2 decimal places not working
- Error dynamically adding a highchart
- How can I prevent tooltip to appears when I hover another element?
- Highcharts add single line to column chart
- Highcharts error 15
- Set color of Highcharts series bar based on value
- In Highchart, how to change all the legend symbols height in a multiple axes chart?
- difference between 'stackLabels' and 'dataLabels' in highcharts
- Django timeseries format and highcharts