vue-chart-3 | 📊 A simple wrapper around Chart.js for Vue | Command Line Interface library
kandi X-RAY | vue-chart-3 Summary
kandi X-RAY | vue-chart-3 Summary
A simple wrapper around Chart.js 3 for Vue 2 & 3
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-chart-3
vue-chart-3 Key Features
vue-chart-3 Examples and Code Snippets
Community Discussions
Trending Discussions on vue-chart-3
QUESTION
EDIT: My codesandbox is working, but it's not perfect. In my actual project I've better utilized ts and am just making an if check for the charttype so the font doesn't paste on all the charts you have. I still need to work on making the fontsize responsive and prettier, but I will try and update the codesandbox as much as I can!
If anyone would like to add to it please do! Also, post your link in the comments so anyone else having these issues can see them too!
I am attempting to make a doughnut chart that looks like this:
I've been trying to figure out how to get the code in this example using VueChartJS (VueChart3 is a TS safe rewrite of VueChartJS and works the same, just in composition API), but cannot figure out how to get the plugins to work properly.
vue-chartjs - Doughnut chart with text in the middle
The example in the post above uses a textCenter()
function and constantly access the context ctx
variable. The first error I get however reads Property 'pluginService' does not exist on type 'typeof Chart'
and also a Cannot read properties of undefined (reading 'register')
. I think this has to do with the way VueChart3 and it's Chart.register(...registerables)
line.
I've commented out all of the code that breaks the chart currently while I try and fix this issue. I am really stumped on where to go with this now and could really use a bit guidance.
Cheers!
Chart2.vue
...ANSWER
Answered 2022-Jan-06 at 19:58This is because pluginService
is V2 syntax, to register plugins globally in V3 you can do it the same way you did with the registerables like so:
QUESTION
I have a vue2 project that uses ClassComponents and Chart.js (via vue-chart-3). I now have a simple component that wraps a DoughnutChart to manage data and stuff.
DBOverviewDoughnut.vue
ANSWER
Answered 2022-Jan-01 at 19:31You need to use VueCompositionAPI inside your spec as well when you mount the component. You can do this by creating a local Vue instance inside your spec, adding VueCompositionAPI as a plugin to the instance and using the instance when you mount the component. https://vue-test-utils.vuejs.org/api/options.html#localvue
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-chart-3
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page