sChart.js:A simple HTML5 charts
sChart.js sChart.js:Small & simple HTML5 charts.Vue-schart is a widget that encapsulates the sChart.js chart library using vue.js. Support vue.js 1.x & 2.x. there are not too many chart types, including only the histogram, line chart, pie chart an
vue-schart
:bar_chart: Vue.js wrapper for sChart.js
Support for use at the mobile. Support vue.js 1.x & 2.x
Usage
Install:
npm install vue-schart -S
Use in component:
<template>
<div id="app">
<schart class="wrapper" :canvasId="canvasId" :type="type" :data="data" :options="options"></schart>
</div>
</template>
<script>
import Schart from 'vue-schart';
export default {
data() {
return {
canvasId: 'myCanvas',
type: 'bar',
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>
<style>
.wrapper{
width: 7rem;
height: 5rem;
}
</style>
Options
Refer to the documentation for sChart.js.