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

122
Views
Vue.js passed data undefined

I am passing data from a parent component to a child component in Vue.js and everything's fine, but where I get stuck is that I can console log the passed data but not feed it to a chart.js diagramm.

export default {
  extends: Doughnut,
  props: {
    carbonDataChart: Object
  },
  data: () => ({
    chartdata: {
      labels: ['Slabs', 'Beams', 'Columns', 'Foundation', 'Core'],
      datasets: [
        {
            data: [this.carbonDataChart.slabs, this.carbonDataChart.beams, this.carbonDataChart.columns, this.carbonDataChart.foundations, this.carbonDataChart.core]
        }
      ]
    },
  }),
  mounted () {
    this.renderChart(this.chartdata, this.options)
    console.log("Carbon data from carbon chart")
    console.log(this.carbonDataChart.slabs)
  }
}

When I do this the console logs the correct value, but for the chart I get this error. enter image description here

Could someone help me out?

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!