+0
日增长
5,715
stars
800
forks
66
watchers
448
prs
654
issues
80
releases
README
vue-chartjs
vue-chartjs is a wrapper for Chart.js in Vue. You can easily create reuseable chart components.
Supports Chart.js v4.
QuickStart
•
Docs
•
Stack Overflow
Quickstart
Install this library with peer dependencies:
bash
pnpm add vue-chartjs chart.js
or
yarn add vue-chartjs chart.js
or
npm i vue-chartjs chart.js
Then, import and use individual components:
vue
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
BarElement,
CategoryScale,
LinearScale
} from 'chart.js'
import { Bar } from 'vue-chartjs'
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)
export default {
name: 'App',
components: {
Bar
},
data() {
return {
data: {
labels: ['January', 'February', 'March'],
datasets: [{ data: [40, 20, 12] }]
},
options: {
responsive: true
}
}
}
}
Need an API to fetch data? Consider Cube, an open-source API for data apps.
Docs
- Reactivity
- Access to Chart instance
- Accessibility
- Migration from v4 to v5
- Migration from vue-chart-3
- API
- Examples
Build Setup
bash
install dependencies
pnpm install
build for production with minification
pnpm build
run unit tests
pnpm test:unit
run all tests
pnpm test
Contributing
1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
License
This software is distributed under MIT license.Top issues
#1012[Bug]: Can't get chart instance with composition api13 comments · 2023-03-20#400Translate Documentation10 comments · 2018-08-09#1080[Bug]: Error: "category" is not a registered scale.7 comments · 2024-01-21#1058[Bug]: Wrong typings for Bar component7 comments · 2023-10-18#1048Mixed chart types support5 comments · 2023-07-07#1121[Bug]: Animations sporadically not working4 comments · 2026-02-16#1117[Bug]: Reactive data doesn't work (Maximum call stack size exceeded)3 comments · 2025-01-21#1056[Bug]: Line data point can be of type string when using a timescale2 comments · 2023-09-15
Discussions
#1100"RangeError: Maximum call stack size exceeded" -- new error even though code hasn't changed.0 comments · 2024-06-14#1086End of life for packages1 comments · 2024-03-18#1054ChartJS instance always returns null1 comments · 2023-08-21#1053The chart is not updating and when I reload the page it disappears1 comments · 2023-08-02#1044How to add data without running into `Maximum call stack size exceeded`1 comments · 2023-06-10#1033[email protected] [email protected] objects as data0 comments · 2023-05-15#1032Can this lib be used in Nuxt 3?2 comments · 2023-05-12#1029how to re render vuechartjs in composition API0 comments · 2023-05-03
Latest release
v5.3.4 v5.3.4 2026-07-07Bug Fixes Chart instance ref remains null with Vue 3.5.39 (1122) (1123) (5abe08c)