score:5
Accepted answer
I fixed your demo, which has a few errors.
$('#toggle_tooltip').click(function() {
var chart = $("#container").highcharts();
var x_tool = chart.xAxis[0].crosshair.label && chart.xAxis[0].crosshair.label.enabled;
var y_tool = chart.yAxis[0].crosshair.label && chart.yAxis[0].crosshair.label.enabled;
if (x_tool && y_tool) {
chart.xAxis[0].update({
crosshair: false
});
chart.yAxis[0].update({
crosshair: false
});
} else {
chart.xAxis[0].update({
crosshair: {
dashStyle: 'solid',
color: '#248EC6',
label: {
enabled: true,
padding: 8,
}
}
});
chart.yAxis[0].update({
crosshair: {
dashStyle: 'solid',
color: '#248EC6',
label: {
enabled: true,
padding: 8,
}
}
});
}
});
Demo:
Source: stackoverflow.com
Related Query
- How to hide Axes Crosshairs by onclick event in Highcharts
- how to add onclick event handler inside highcharts tooltip
- How can I hide series from a HighCharts legend?
- How to hide labels in the highcharts in the pie
- How can I hide a series from initially being displayed in Highcharts
- How do I add an event listener to a Highcharts object *AFTER* I've created it
- How can i hide all the Series in highcharts at a time
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- How to set a static minimum value for axes in Highcharts
- Highcharts - How to hide series name and Y value in tooltip
- Highcharts : Chart with drilldown how to obtain click event of drill up button
- How to hide a highcharts pie slice programatically
- highcharts how to catch and insert logic in click reset zoom button event
- How to pass custom data into Highcharts graph click event
- how to get chart object inside a point event function in Highcharts
- Add onclick event on chart made with the highcharts library
- How to hide one series data info in tooltip using highcharts
- How to hide color axis in heatmaps using highcharts
- How do I hide a Highcharts series from the chart, but always show it in the tooltip?
- How can I hide and show a category in highcharts
- How to attach click event function in Highcharts
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- How to add series after click event in HighCharts
- How to implement "zebra striping" in highcharts axes
- How Can I Hide a Pie Chart's Slice in HighCharts Without Removing It From the Legend?
- How to use HighCharts to plot aggregate hourly event rates?
- How do i add mouse wheel code in Angular2 highcharts in typescript
- how to display 2 same highcharts without duplicate the code
- How can I pass values from Highcharts event callbacks (click, mouseOver, mouseOut) back to React component member function?
- How to edit tooltip in Highcharts C# code
More Query from same tag
- Load chart with some series/legend items hidden by default
- Highcharts is not displaying in the div at all, resulting in a blank page - Using python flask and jinja template?
- Highcharts/Highstock dynamically add/remove multiple series
- Highcharts: How to plot adjacent scatter points for different box plots
- how to change color of line chart in highchart based on a categorical column in r?
- Highstock graph shows points instead of line at certain zoom levels
- HighChart Data label issue in bar chart
- Show S0-Ticks with Highcharts
- Interpolate or use a variable inside a string in javascript
- Adding HTML label to Highcharts
- How to format PHP into the proper string for JSON in pie chart using highchart
- Full Screen broken - Stock Tools
- How can I get treemap datalabels to wrap consistently?
- Display Data with Xvalues correctly in Highcharts
- How do I hide a Highcharts series from the chart, but always show it in the tooltip?
- Chart Y-Axis fixed interval
- highcharts shows exception "c is undefined" for pie chart
- Highcharts' bullet graph's serie's doesn't extend all the way
- Need assistance for a part with json/php
- Highcharts accessibility / VUE.js
- Configure Highstock export server in Play framework (java) 1.2.5
- Uncaught TypeError: c.color.tweenTo is not a function
- Highcharts - Overlapping scatterplot labels are not readable
- Highcharts - How to export graphic server side?
- Highcharts: create a stacked columnrange chart
- Passing JSON in variable to HighCharts
- How can i loop data in highcharts
- How can I hide tooltip in highcharts
- ionic3 highchart shows error during build
- Angularjs - highchairs in directive