0.2.0 • Published 8 years ago

vue-chart.js v0.2.0

Weekly downloads
88
License
MIT
Repository
github
Last release
8 years ago

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

NameTypeDefaultDescription
responsiveBooleantrueresizes when the canvas container does
titleStringnulltitle text
titleObjectnulltitle configuration
widthNumbernullwidth of chart canvas
heightNumbernullheight of chart canvas
labelsArraystring[]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>
0.2.0

8 years ago

0.1.0

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago