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
- Parsing JSON using jQuery's each from array of arrays
- Can the crosshair in a Highcharts chart set and be moved programmatically?
- Getting the complete XML source out of an XML DOM object
- Combining graphs in highcharts
- How to set plot area width and height in Highcharts?
- Highcharts: One Legend Controls Many Charts
- Add Text on the Sectors of jQuery PieChart (HighCharts)
- how to use highcharts on ABP.NET angularjs
- how to pass the dates to the x-axis in the base line high charts instead of the values
- Highcharts {Pie} - Change dataLabels connector curve
- HIGHCHARTS - Jquery/Ajax access php variables from the php file called by ajax
- Display different value other than x and y axis value
- get Tooltip text/innerHTML on click
- Highcharts not displaying series pushed from JSON
- Highchart multicolour areaspline
- How to change color of single column in Highcharts column graph when data is in CSV form?
- Highcharts Drilldown with breadcrumb navigation
- How to get y-axis boundary line using highchart?
- Adding dotnet highcharts to Xamarin app
- sync width of xAxis between two charts, when one chart has multiple yAxis
- Highcharts Graph displays correctly ONLY on Window Resize
- Highchart x-axis not printing date values
- Why does my highchart only expand horizontally to fill its containing div, and not vertically?
- How to center line in ggplot2::geom_step() similar to highcharter
- Highcharts padding issue
- Highcharts percentage of total for simple bar chart
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to call typescript function inside High chart click event
- highchart column comparison chart like xrange
- How to change tooltip of a column chart programmatically in highchart