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

281
Views
Error when changing data after migrating to vue-chartjs 4

I am migrating from vue-chartjs 3 to 4. I have a LineChart component that I migrated to the last version of VueChart (I put the template section and removed the draw method calls.

This component is used for 2 charts. When I close the first one and want to display the second one, I have a console error:

[Vue warn]: Error in callback for watcher "chartData": "TypeError: Cannot read properties of undefined (reading 'destroy')"

What can be the problem here?

Thanks!

<template>
  <line :chart-data="chartData" />
</template>

<script>
import 'chart.js/auto'
import { Line } from 'vue-chartjs/legacy'

export default {
  name: 'AppLineChart',
  components: { Line },
  props: {
    chartData: {
      type: Object,
      required: true,
    },
}
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The same happened to me, i render my charts in mounted, the solution to me was put my render of the second chart in created instead mounted, i don´t know what happend but the error disappeared :/

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