Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable marker hover in only one marker of highchart

I am trying to convince my highchart to do my bidding and have encountered a problem.

What I want to acchieve: I want one of the markers of the graph to disappear. I want the line to go through (and break at) one point, but the point is completely irrelevant and I do not want that point to pop up when hovering over it. My current code looks something like this:

$(function () {
var chart;
$(document).ready(function() {
    chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },   
        plotOptions: {
            series: {
                states: {
                    hover: {
                        enabled: true
                    }
                }
            }
        },
        series: [{
            marker: {
                enabled: false
            },
            data: [15.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, {
                y: 26.5,
                marker: {
                    enabled: false,
                    states: {
                        hover: {
                            enabled: false
                        }
                    }
                }
            }, 23.3, 18.3, 13.9, 9.6]    
        }]
    });
});
});

And all my markers behave the same: they are not visible until I hover over them, at which point they pop up. What I want is for all my markers to behave as they do in the provided code, with the exception of the marker at y=25.6. I want the behaviour of this marker be the same as the behavior I get from all markers when i set

hover:{ enabled: false }

in my original code. That is, I want the marker to "dissapear" completely.

Thanks in advance for all your help. Jan

like image 515
5xum Avatar asked Jul 19 '13 09:07

5xum


2 Answers

Try this in your series: enableMouseTracking: false

In your case, it would be:

series: [{ 
    data: [15.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, {
        enableMouseTracking: false,
        y: 26.5
    }, 23.3, 18.3, 13.9, 9.6]    
}]

I hope this helps!

(Update on 6/23/17): For those who want to apply this to every series in the chart, not just one, you would do the following:

plotOptions: {
    series: { enableMouseTracking: false }
}
like image 130
Mike Zavarello Avatar answered Sep 22 '22 22:09

Mike Zavarello


This is unfortunately bug in Highcharts, see this.

like image 45
Paweł Fus Avatar answered Sep 23 '22 22:09

Paweł Fus