Vue Chartkick

1.1.0 · active · verified Sun Apr 19

Vue Chartkick is a wrapper for the Chartkick.js library, designed to simplify the creation of interactive charts within Vue.js applications. It provides a declarative, component-based API that allows developers to render various chart types with minimal code. The library acts as an abstraction layer, supporting popular underlying charting engines like Chart.js, Google Charts, and Highcharts. The current stable version, 1.1.0, is specifically built for Vue 3, with version 0.6.1 being the last compatible version for Vue 2 applications. Its key differentiators include one-line chart component syntax, the ability to fetch chart data directly from API endpoints for improved performance, and broad support for different charting libraries, offering flexibility in visualization choices.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install `vue-chartkick` and `chart.js`, then register the plugin globally in a Vue 3 application to render basic line and pie charts.

import { createApp } from 'vue'
import VueChartkick from 'vue-chartkick'
import 'chartkick/chart.js'
import App from './App.vue'

// In your main.js or similar entry file
const app = createApp(App)
app.use(VueChartkick)
app.mount('#app')

// Example App.vue
// <template>
//   <div>
//     <h1>My Dashboard</h1>
//     <line-chart :data="{'2021-01-01': 11, '2021-01-02': 6}"></line-chart>
//     <pie-chart :data="[['Blueberry', 44], ['Strawberry', 23]]"></pie-chart>
//   </div>
// </template>
// <script>
// export default {
//   name: 'App'
// }
// </script>

view raw JSON →