vue-schart is a small component that uses vue.js to encapsulate the sChart.js chart library. Support vue.js 1.x & 2.x
Warehouse address:
sChart.js As a small and simple chart library, there is no There are many chart types, including only four basic charts: bar chart, line chart, pie chart and donut chart. Small but complete. sChart.js can basically meet the needs of these four charts. And its small size is reflected in its size. The code is only 8kb. If it is compressed by Gzip on the server, it will be even smaller, so there is no need to worry about redundant project code.
This library is implemented using canvas and is compatible with IE9 and above browsers.
Warehouse address:
Documentation (Chinese and English):
Demo address:
npm install vue-schart -S
<template><p id="app"><schart :canvasId="canvasId" :type="type" :width="width" :height="height" :data="data" :options="options"></schart></p></template><script>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}}</script>
The above is the detailed content of Detailed introduction to vue-schart. For more information, please follow other related articles on the PHP Chinese website!