https://github.com/seregpie/vuechart
A simple wrapper for Chart.js.
https://github.com/seregpie/vuechart
Last synced: 5 months ago
JSON representation
A simple wrapper for Chart.js.
- Host: GitHub
- URL: https://github.com/seregpie/vuechart
- Owner: SeregPie
- License: mit
- Created: 2017-08-15T09:04:27.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2021-05-24T17:37:39.000Z (almost 4 years ago)
- Last Synced: 2024-04-29T17:20:59.809Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 24
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VueChart
A simple wrapper for Chart.js.
Works for Vue 2 & 3.
## dependencies
- [VueDemi](https://github.com/antfu/vue-demi)
## setup
### npm
```shell
npm i @seregpie/vue-chart
```---
```javascript
import VueChart from '@seregpie/vue-chart';
```### browser
```html
```
The module is globally available as `VueChart`.
## usage
Register the component globally.
```javascript
import {createApp} from 'vue';
import VueChart from '@seregpie/vue-chart';let app = createApp({/*...*/});
app.component(VueChart.name, VueChart);
app.mount('body');
```*or*
Register the component locally.
```javascript
import VueChart from '@seregpie/vue-chart';export default {
components: {
VueChart,
},
// ...
};
```---
```html
```
## properties
| name | type | description |
| ---: | :--- | :--- |
| `data` | `Object` | The data of the chart. |
| `options` | `Object` | The configuration options of the chart of the current type. |
| `type` | `String` | The type of the chart. Changing the value will recreate the chart. |
| `updateMode` | `String` | The mode for the update process. |