Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-chart-js

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-chart-js

Chart.js for VueJs.

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
321
increased by4.22%
Maintainers
1
Weekly downloads
 
Created
Source

vue-chart-js

npm npm npm npm

Chart.js wrapper component based on Vue.

Works with Vue 2.*

Installation

Install via CDN

<script src="https://unpkg.com/chart.js"></script>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-chart-js"></script>

<script>
  Vue.use(VueChart.default)
</script>

Install via NPM

$ npm install vue-chart-js --save
Register as Component
import Vue from 'vue'
import VueChart from 'vue-chart-js'

export default {
  name: 'App',

  components: {
    VueChart
  }
}
Register as Plugin
import Vue from 'vue'
import VueChart from 'vue-chart-js'

Vue.use(VueChart)

Usage

<template>
  <vue-chart type="bar" :data="chartData"></vue-chart>
</template>

<script>
import VueChart from 'vue-chart-js'

export default {
  name: 'App',

  components: {
    VueChart
  },

  data: () => ({
    chartData: {
        labels: ['Item 1', 'Item 2', 'Item 3'],
        datasets: [
            {
                label: 'Component 1',
                data: [10, 20, 30]
            },
            {
                label: 'Component 2',
                data: [20, 30, 40]
            }
        ]
    }
  }),
}
</script>

Props

PropsDescriptionTypeRequired
typeChart.js typeStringtrue
dataChart.js datasetsObjecttrue
optionsChart.js optionsObjectfalse
widthChart widthNumberfalse
heightChart heightNumberfalse

License

Vue-Chart-Js is open-sourced software licensed under the MIT license

Keywords

FAQs

Package last updated on 24 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc