this.renderChart is not a function when using default example
See original GitHub issueWhat other configurations or imports do I need to make, i get TypeError: this.renderChart is not a function when I use the example given as,
import { Bar } from 'vue-chartjs'
export default {
extends: Bar,
mounted () {
// Overwriting base render method with actual data.
this.renderChart({
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
datasets: [
{
label: 'GitHub Commits',
backgroundColor: '#f87979',
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11]
}
]
})
}
}
do i need to define the function or what?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
this.renderChart is not a function VueJs Chart.js - Stack Overflow
You are using V4 of vue-chart.js, the chart creation process has been changed as you can read here in the migration guide.
Read more >How to use the vue-chartjs.mixins.reactiveProp function ... - Snyk
To help you get started, we've selected a few vue-chartjs.mixins.reactiveProp examples, based on popular ways it is used in public projects.
Read more >Vue-chartjs error in BaseCharts.js renderChart - Get Help
I got trouble while trying to add chart using vue-chartjs on my application. Firstly I install vue-chartjs npm install vue-chartjs chart.js ...
Read more >Getting Started - vue-chartjs
vue-chartjs lets you use Chart.js without much hassle inside Vue. ... charts have data change watcher and options change watcher by default.
Read more >vue-chartjs | Yarn - Package Manager
_updateFromParent is not a function #72; Styling componement's surrounding <div> #70 ... mergeOptions to merge default options with user's options #5.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same error, and using mixins doesn’t work too.
Can you post a reproduction? Generally this seems right.
You are extending the
Bar
component and like a mixin you have all methods and props defined in there. Sothis.renderChart()
should be available.You could try
mixins: [Bar]
instead ofextends