vue-chart-3
v3.1.8
Published
📊 A simple wrapper around Chart.js 3 for Vue 2 & 3
Downloads
82,581
Maintainers
Readme
📊 Chart.js 3 for Vue 2 and Vue 3
This package is a rewrite of vue-chartjs for Chart.js 3, but written in Typescript with Vue 3 composition api in mind.
Vite.js
andNuxt 3
compatible 💯.
Documentation
Installation
For Vue 3
npm i vue-chart-3 chart.js
#or
yarn add vue-chart-3 chart.js
#or
pnpm i vue-chart-3 chart.js
For Vue 2
npm i vue-chart-3@legacy chart.js
#or
yarn add vue-chart-3@legacy chart.js
#or
pnpm i vue-chart-3@legacy chart.js
Important notes
Using with Vue 3 or Vue 2
This package works with version 2.x and 3.x of Vue.
- Vue 3 works out-of-the-box
- Vue 2 requires
@vue/composition-api
package to also be installed and registered, to provide Vue 3's Composition API features likeref, defineComponent, computed, reactive
.
Demos
- Vue 3: CodeSandbox demo Vue 3
- Vue 2 + composition API: CodeSandbox demo Vue 2 + composition
- Vue 2 + Typescript + class API CodeSandox demo Vue 2 + class
- Nuxt 2 + SSR CodeSandbox demo Nuxt 2 + SSR