vue-chart.js

Chart.js for Vue
10,566 4
Install
npm install vue-chart.js
Latest Version:0.2.0
Vue:1
License:MIT
Last Updated:Sep 22, 2016
Links: GitHub  ·  npm
Maintainer: hanai

vue-chart.js

NPM version Dependency Status License

Chart.js for Vue

Install

$ npm i vue-chart.js

Chart Components

  • BarChart
  • LineChart
  • RadarChart
  • PieChart
  • DoughnutChart
  • PolarAreaChart

Common Chart Props

Name Type Default Description
responsive Boolean true resizes when the canvas container does
title String null title text
title Object null title configuration
width Number null width of chart canvas
height Number null height of chart canvas
labels Array[string] [] labels of category axis

Example

<template>
<bar-chart :width="600" :height="300" :responsive="false" :labels="labels" :datasets="datasets" :options="options"></bar-chart>
</template>

<script>
import {BarChart} from 'vue-chart.js';

export default {
  data: {
    labels: ["January", "February", "March", "April", "May", "June", "July"],
    datasets: [
      {
        label: "My First dataset",
        backgroundColor: "rgba(220,220,220,0.2)",
        borderColor: "rgba(220,220,220,1)",
        borderWidth: 1,
        hoverBackgroundColor: "rgba(220,220,220,0.2)",
        hoverBorderColor: "rgba(220,220,220,1)",
        data: [65, 59, 80, 81, 56, 55, 40],
        yAxisID: "y-axis-0",
      }, {
        label: "My Second dataset",
        backgroundColor: "rgba(220,220,220,0.2)",
        borderColor: "rgba(220,220,220,1)",
        borderWidth: 1,
        hoverBackgroundColor: "rgba(220,220,220,0.2)",
        hoverBorderColor: "rgba(220,220,220,1)",
        data: [28, 48, 40, 19, 86, 27, 90]
      }
    ],
    options: {}
  },
  components: {
    BarChart
  }
}
</script>

Related Packages

vue-chart-js

Chart.js for VueJs.

10,491 33
hchs-vue-charts

Base on Vue2.0 wrapper for ChartJs.

70,593 353
@j-t-mcc/vue3-chartjs

Vue3 wrapper for Chart.js

207,152 119
@efont/vue-baselib

vue-baselib

2,721 2
@phronesyss/bar-chart

This is the first part of the admetricks challenge, that consist on creating two...

407 0

Version History

Version Released License
0.2.0 MIT
0.1.0 MIT
0.0.9 MIT
0.0.8 MIT
0.0.6 MIT