jackdizhu / vue-schart

vue 图表组件

Home Page:http://blog.gdfengshuo.com/example/#/vue-schart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-schart

📊 Vue.js wrapper for sChart.js

Downloads Version License

Support vue.js 1.x & 2.x

interactive demo

Usage

Install:

npm install vue-schart -S

Use in component:

<template>
    <div id="app">
        <schart :canvasId="canvasId"
			:type="type"
			:width="width"
			:height="height"
			:data="data"
			:options="options"
		></schart>
    </div>
</template>
import Schart from 'vue-schart';
export default {
	data() {
		return {
			canvasId: 'myCanvas',
			type: 'bar',
			width: 500,
			height: 400,
			data: [
				{name: '2014', value: 1342},
				{name: '2015', value: 2123},
				{name: '2016', value: 1654},
				{name: '2017', value: 1795},
			],
			options: {
				title: 'Total sales of stores in recent years'
			}
		}
	},
    components:{
		Schart
	}
}

Options

Refer to the documentation for sChart.js.

Demo

demo

License

MIT license.

About

vue 图表组件

http://blog.gdfengshuo.com/example/#/vue-schart

License:MIT License


Languages

Language:Vue 100.0%