score:6

Accepted answer

unfortunately each point doesn't have a zindex property. but like bubbles mentioned, you can always add the point to the end so that it gets rendered very last and hence shows up on top.

also, instead of looping through all the points and adding styles directly to the element, i would recommend leveraging the states:select option of highcharts. you can then set a particular style for the selected state and all you need to do is trigger a select() on the point you want to highlight

    marker: {
        states: {
            select: {
                fillcolor: '#00ff00'
            }
        }
    }

here is how you could highlight the point by pushing it to the end and triggering a select() on it

function highlightpoint(point){
    //save the point state to a new point
    var newpoint = {
        x: point.x,
        y: point.y
    };
    //remove the point
    point.remove();
    //add the new point at end of series
    chart.series[0].addpoint(newpoint);
    //select the last point
    chart.series[0].points[chart.series[0].points.length - 1].select();
}

demo @ jsfiddle

score:0

a nuance of the solution above because the above suggestion did not worked for me. i've got a case where the point for the toolip was not clickable in area chart when areas were overlapping although the tooltip was showing.

it worked out by adding in the tooltip formatter the solution above but to the parent group.

tooltip :{
   ...
   formatter () {
        this.point.graphic.parentgroup.tofront();
        ...
   }
}

score:3

highcharts are made out of svg elements, which are not directly controlled by things like z-index. however, you still can control what elements are rendered ontop of what - the last element in an svg tree is drawn over the rest, so to promote an element to the front you can just pop it out, and append to the svg element containing the chart.

score:7

update as of 2014

this is an old question, but i thought i would update it for highcharts as of 2014. one can now use the built-in method element.tofront() which automatically pops and re-appends to the top.

an example to move point at data index i would then be:

chart.series[0].data[i].graphic.tofront()

and thats all it takes!

api source


Related Query

More Query from same tag