score:19
to make the points on the chart clickable set allowPointSelect
as true
plotOptions:{
series:{
allowPointSelect: true
}
}
now you handle the click event or selection event from the
plotOptions:{
series:{
point:{
events:{
select: function(e){
//your logic here
}
}
}
}
}
I've updated your fiddle here http://jsfiddle.net/a6yL8/1/
API ref link : http://api.highcharts.com/highstock#plotOptions.series.point.events
I hope this will help you
score:0
https://stackoverflow.com/a/20964524 is nice.
But,
By default, click on line instead of point will also trigger click event, to only allow click on points: plotOptions.series.point.events.click
click: function (e) {
let $target = $(e.target)
if (!$('<b></b>').addClass($target.attr('class')).is('.highcharts-point, .highcharts-halo')) {
return
}
// do your work below ↓
}
score:2
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JQuery
$(function () {
$('#container').highcharts({
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
plotOptions: {
series: {
marker: {
enabled: true,
symbol: 'circle',
radius: 1,
states: {
hover: {
enabled: true
}
}
},
cursor: 'pointer',
point: {
events: {
click: function() {
alert('okk');
}
}
}
}
},
legend: {
type: 'area',
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Tokyo',
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}]
});
});
click here jsfiddle
Source: stackoverflow.com
Related Query
- Highcharts - making a point clickable?
- making title in highcharts clickable and work with bootstrap popover?
- making series in Highcharts clickable
- Making two series point in opposite directions in highcharts
- Making a drawing clickable in highcharts
- How to Increase minimum point value and the color of series in advanced accessible charts in Highcharts by making it traverse
- How do I increase the clickable area of a point in Highcharts so that whenever the point is 'active' a click can be recorded?
- Making a specific chart clickable in highcharts
- Highcharts - manually trigger hover event on a point
- Highcharts => Getting the id of a point when clicking on a line chart
- How to get Highcharts X-Axis Categories starting at the left most point
- How do I dynamically change a data point in Highcharts using JavaScript
- Highcharts scatter chart with a name per point
- Highcharts highlight single point on line
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- highcharts customize tooltip for a single point
- Highcharts - only show tooltip when hovering directly on point
- How do I get the value of a highcharts graph point on mouseover?
- Making a Highcharts plot with Python
- Highcharts - Draw Crosshairs / Tooltip on Mouse Position Instead of Snapping to Data Point
- Selecting a point by ID using Highcharts
- Changing the color of the point dynamically in highcharts
- Highcharts - How to remove connecting line between fixed tooltip and point
- Adding only one clickable point to the chart in Highcharts?
- create a sticky tooltip for a point or a permanent label using HighCharts
- how to get chart object inside a point event function in Highcharts
- highcharts - removing decimal places on Y axis with only one point
- How do I set highcharts line graph point colors to an array of colors?
- Highcharts axis label before first point
- Highcharts - Provide URL's for series data to open clickable link
More Query from same tag
- error NG6001: Cannot declare 'Highchar tsChartComponent' in an NgModule as it's not a part of the current compilation
- How to modify highstock chart so that it can be used for displaying ranks (Lowest values on highest points)
- how to disable or override the fonts inherited from svg in the web pages by default
- Highcharts how to customize enableMouseTracking?
- Highcharts: adding symbol to inverted columnrange chart series
- Trouble converting time to UTC for highstocks
- Need to link URL in HighChart
- Highcharts custom colours
- How to link inside map to other map?, or how to change geojason dinaminacally?
- Highcharts: how to change the yAxis title programatically?
- Can I change series array completely in highcharts
- Offline exporting a Highcharts chart using an external button
- Angular / Jquery selectors result an error when running Protractor
- Highcharts series label
- Highcharts SVG Export from Python Server Side Code
- Highcharts: Remove extra margin y-axis when plotting multiple series
- Highcharts - Cannot display data labels on a spline chart
- Highstock shared tooltip multiple series - show data for line when not on point
- Bind dynamic Json data in pie chart
- Reduce no of points in X axis HighChart
- Having trouble mapping highcharter aesthetics to reactive object elements
- HighCharts: How to include text event to the left of chart when exporting
- how to animate highcharts marker symbol on chart load
- Plotband covered area columns to be highlighted or set opacity higher in highchart column type
- Why are there disabled buttons in HighStock Range Selector?
- How to draw Balanced yAix in HighCharts?
- How to display highchart y axis with constistant data
- How to pass all the data in dataframe that extract from excel sheet to highchart?
- Highcharts: reading data from a dictionary stored in a text file
- Trigger HighCharts Animation on View in Owl Carousel