Skip to content

Commit

Permalink
'更新readme.md'
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-xin committed Apr 25, 2018
1 parent a866be0 commit 7b1f93f
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions README.md
Expand Up @@ -23,41 +23,42 @@ npm install vue-schart -S

Use in component:

```javascript
```html
<template>
<div id="app">
<schart :canvasId="canvasId"
:type="type"
:width="width"
:height="height"
:data="data"
:options="options"
></schart>
<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',
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'
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
}
},
components:{
Schart
}
</script>

<style>
.wrapper{
width: 7rem;
height: 5rem;
}
</style>
```
## Options

Expand Down

0 comments on commit 7b1f93f

Please sign in to comment.