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

125
Visualizações
HIghcharts redraw packedbubble using vue composition api

I am trying to figure out how to re render the packedbubble chart when a prop changes without any good outcome... Before trying to do the "redraw", returning the chart was working fine, not updating with the props changes, but drawing at least something.

So far I have the following code:

<template>
  <div id="thechart"></div>
</template>

export default {
  name: 'OrgChart',
  props: {
    chartData: { ... }
  },
  setup (props) {
    //...
    
    const employeeSeries = []
    const keys = Object.keys(props.chartData)
    keys.forEach((key, index) => {
      employeeSeries.push({
       name: key,
       data: props.chartData[key]
      })
    })

    watch(() => props.chartData, (selection, prevSelection) => {
      redraw()
    })

    function redraw () {
      chart.value.series.setData(employeeSeries, true)
    }

    onMounted(() => {
      var highchartsOptions = {
        chart: {
          type: 'packedbubble',
          height: '50%',
          renderTo: 'thechart'
        },
        //...,
        series: employeeSeries
      }
      chart.value = new HighCharts.chart(highchartsOptions)
    })
    return {
      chart
    }
  }
}
</script>

any idea? Thanks.

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