Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda