Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:52:30+00:00 2026-06-15T14:52:30+00:00

here is my problem, when you set useHTML: true for datalabels, it seems that

  • 0

here is my problem, when you set useHTML: true for datalabels, it seems that the label text will override the tooltip background.

You can see the behaviour in this simple fiddle: bar chart

Try to display a tooltip on mouse over a bar, and you will see the text of the datalabel in the tooltip background.

Is it possible to set a z-index on the data labels?

I’ve tried to add this in the tooltip definition but without success:

style : {
    color: 'black',
    'z-index': 0
    },

I’ve also tried to set up span classes for data labels and tooltips, then add a z-index into css properties for these classes, but it’s still not working.

Edit: As I’m still searching for a solution to my problem, can someone could point me the way to add a class to the bars (or the datalabels) of the charts? My aim is to call a specific onclick event on this class.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:52:31+00:00Added an answer on June 15, 2026 at 2:52 pm

    Ok, so here is a workaround for my problem… The idea is to create your own custom tooltip.

    The solution was given on the Highcharts forum: Highcharts forum post

    To do so, set the ‘useHTML’ property on both datalabels and tooltips, remove some defaults properties of the tooltips and setup the CSS classes in the formatters functions:

    //JS
    datalabels: {
        ...
        useHTML: true,
        formatter: function() {
            return ("<span class='datalabel'>" + this.y + "</span>");
        }
    }
    
    tooltip: {
        ...
        borderWidth:0,
        borderRadius:0,
        shadow:false,
        useHTML: true,
        formatter: function() {
            return ("<div class='tooltip'>" + this.y + "</div>");
        }
    }
    

    The final step (the most important) is to set up the CSS rules for the highcharts-tooltip span class (which is used by Highcharts to render HTML tooltips).

    //CSS
    .highcharts-tooltip span {
        background-color:white;
        z-index:9999!important;  
    }
    

    Notice the z-index property, which is the property that will allow the tooltip to render over the datalabel.

    Now you can just custom your tooltip by setting CSS rules for the ‘tooltip’ class.

    For a full live example, see the jsfiddle here: Custom tooltip

    Note: It is not mandatory to specificy the datalabel class in the formatter for this solution to works, I just need so I can register a specific mouse event on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here I am facing a problem, I will explain: I set up a calendar
Very peculiar problem here, Simply the background image asset will display fine on ALL
Annoying newbie problem here. This variable isPlayerTouchingAnotherPlayer is being set to true as soon
Here is the problem from code chef : A set of N dignitaries have
Here's my problem: I'm trying to set up a simple mobile contact form with
Here i got a problem in my script, Once we set one radio button
Here is a real-world combinatorial optimization problem. We are given a large set of
date here my problem: String datetime = 2012-03-24 23:20:51; I know that that string
Well the problem here is that if you have one DataTemplate for a type
I have a problem here that still cannot solve, the thing is I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.