Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable hover on HighCharts

I have building a pie chart using HighCharts library, and here is my chart:

 // http://jsfiddle.net/t2MxW/20890/      var chart = new Highcharts.Chart({         colors: ['#0072BC', '#BFDAFF', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],         credits: { enabled: false },         chart: {                renderTo: 'container',                backgroundColor: 'rgba(255, 255, 255, 0.1)',                type: 'pie',                margin: [0, 0, 0, 0],                spacingTop: 0,                spacingBottom: 0,                spacingLeft: 0,                spacingRight: 0         },         title: { text: null },         plotOptions: {                pie: {                    allowPointSelect: false,                    size: '100%',                     dataLabels: { enabled: false }                }        },        series: [{                showInLegend: false,                type: 'pie',                name: 'Pie Chart',                data: [                      ['Mobile', 65], // first half of pie                      ['Other', 35] // second half of pie                ]        }]     }); 

But the problem is that I don't want appearing tooltip on mouse over...

Is it possible to disable tooltip on hover?

like image 962
Vytalyi Avatar asked Apr 26 '13 08:04

Vytalyi


2 Answers

Disabling tooltip just disables the tooltip but the hover effect is still present. To disable the hover effect, add the following to your plotOptions:

    plotOptions: {         series: {             states: {                 hover: {                     enabled: false                 }             }         }     }, 
like image 120
SergeyB Avatar answered Sep 29 '22 17:09

SergeyB


You need to set the tooltip attribute to false, like so:

tooltip: { enabled: false }, 

jsFiddle here


Here's the full code for your case:

var chart = new Highcharts.Chart({        colors: ['#0072BC', '#BFDAFF', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],        credits: { enabled: false },        tooltip: { enabled: false },        chart: {               renderTo: 'container',               backgroundColor: 'rgba(255, 255, 255, 0.1)',               type: 'pie',               margin: [0, 0, 0, 0],               spacingTop: 0,               spacingBottom: 0,               spacingLeft: 0,               spacingRight: 0        },        title: { text: null },        plotOptions: {               pie: {                   allowPointSelect: false,                   size: '100%',                    dataLabels: { enabled: false }               }       },       series: [{               showInLegend: false,               type: 'pie',               name: 'Pie Chart',               data: [                     ['Mobile', 65], // first half of pie                     ['Other', 35] // second half of pie               ]       }] }); 
like image 23
dsgriffin Avatar answered Sep 29 '22 19:09

dsgriffin