Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!