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

141
Visualizações
Is there a way to update the Doughnut chart of Chart.js but not lose the tooltip

I'm working with Chart.js. When I mouse over one piece on Doughnut chart, I want to make less opaque the other pieces and don't lose the tooltip. this is the chart's first version

This is what i want to do -- when i mouse over one piece, other pieces need to be less opaque When i try to do this on hover event, i need to change backgroundColor color and update the chart. It works, it is changing chart color but because i update the chart, i lose my tooltip.

options = {
  hover: {
    onHover: (e, item: any) => {
      if (item.length) {
        item[0]._chart.config.data.datasets[0].backgroundColor = ['#131e3a', '#19284d', '#1f3260']
        item[0]._chart.update();
      }
    }
  },

Is there any way to update the chart colors but not lose the tooltip?

about 4 years ago · Juan Pablo Isaza
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