Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
How to hide tooltip for certain bars in chart.js

I am making a stacked bar that looks like the following:

enter image description here

The spaces you see in between each bar are bars static-sized bars that are the color of the background. I used them because I could not figure out how to add a space between bars in chart.js. I am trying to figure out how to hide the tooltip for the static-sized gray bars. As of right now, my code shows a black tooltip that freezes until I refresh the page when I hover over a gray bar. Here is the code for hiding it so far:

filter: function(tooltipItem) {
    return tooltipItem.dataset.backgroundColor[0] !== "#f5f5f5";
    // if (tooltipItem.dataset.backgroundColor[0] == "#f5f5f5") {
    //     return false;
    // }
    // console.log(tooltipItem.dataset.backgroundColor);
    // return true;
 }
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

I figured out how to get this to work. I hid the labels based on the background-color of a bar.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda