I'm trying to get the highcharts tooltip to have a zIndex using useHTML
to position it over another HTML element.
See this fiddle: http://jsfiddle.net/sDu8V/
I'd like the tooltip to go over the pink box - instead of under it.
What am I missing?
I'm trying to get the highcharts tooltip to have a zIndex using useHTML
to position it over another HTML element.
See this fiddle: http://jsfiddle.net/sDu8V/
I'd like the tooltip to go over the pink box - instead of under it.
What am I missing?
Possible solution: http://jsfiddle.net/sDu8V/1/
Required CSS:
.highcharts-container {
position: inherit !important;
}
.highcharts-tooltip {
z-index: 9998;
}
Thanks to @Piotr, updated design for 4.1.x.
You can't have only the tooltip to get rendered over the pink box because the whole chart is rendered in a single SVG object that is either totallly over or beneath your pink both.
What you can do is to render the whole chart over the pink box by making it background transparent.
Your chart:
chart: { backgroundColor:'transparent' }
Your div should also be beneath the chart:
<div id="box" style="z-index:0"></div>
Live example: http://jsfiddle.net/7TcJ6/
if you are searching solution when you have no access to the tooltip class so you can do this, paste this code below before your Highchart.chart
or component initialization (btw works for React as well)
(function (H) {
H.wrap(H.Tooltip.prototype, "getLabel", function (proceed) {
var t = proceed.apply(this, Array.prototype.slice.call(arguments, 1));
if (this.container) {
H.css(this.container, { zIndex: 1301 });
}
return t;
});
})(Highcharts);
it works for me, in my case tooltip is outside:true
so its rendered in its own portal, but you still can put its class highcharts-tooltip-container
in your global CSS file
I hope it will help to someone
© 2022 - 2024 — McMap. All rights reserved.