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

231
Visualizações
How to dynamically change mouse event functions in Highchart?

I'm using Highchart networkgraph for a directed graph.

I want the users to be able to on node hover highlight the shortest path from the start node. I also have some checkboxes that would highlight the shortest node from start to the specified node. I've managed to do it. but the bit I'm having some issue with is that upon selecting a checkbox I want to 'disable' the BFS algorithm, keeping the highlighted path and letting the user explore the nodes (each node has a tooltip popup as well on hover)

I've made a small demo that showcases my issue. Demo

I've tried to disable all states (inactive, hover, selected) and update each marker with the node.update() method, but without success. I've also tried to change the point.events in the chartOptions state to undefined or to another function, but then the default states interfere with the functionality. I've ran out of ideas.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

For disabled all state you can use enableMouseTracking: false, which will turn off all states. https://api.highcharts.com/highcharts/plotOptions.networkgraph.enableMouseTracking

  const updateSeries = () => {
    setChartOptions({
      series: [
        { 
          enableMouseTracking: false,
          data: [Math.random() * 5, 2, 1] 
        },
        { 
          data: [Math.random() * 5, 2, 1] 
        },
      ]
    });
  };

https://stackblitz.com/edit/react-ewhvow?file=index.js

Another option would be to add an event in series, events.mouseOut, events.mouseOver, and there change the state of the marker to visible or not.

https://jsfiddle.net/BlackLabel/shxo8Lj6/

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