muni
muni

Reputation: 1360

How to stop Highmaps on mouse hover to change SVG path orders

In all Highmaps when we hover on any particular country, the hoverd country SVG path put at the bottom in order to show hovered country on the top of others (the way we achieve z-index in svg). I don't want Highmaps on mouse hover to change SVG path orders.

Upvotes: 0

Views: 72

Answers (1)

ppotaczek
ppotaczek

Reputation: 39099

You can wrap zIndexSetter method to call it only if the element is not a path:

(function(H) {
    H.wrap(H.SVGElement.prototype, 'zIndexSetter', function(proceed, value, key, el) {
        if (!el || (el && el.tagName !== 'path')) {
            return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
        }
    });
}(Highcharts));

Live demo: https://jsfiddle.net/BlackLabel/31a0x4sL/

Docs: https://www.highcharts.com/docs/extending-highcharts

Upvotes: 1

Related Questions