Skip to content

Commit

Permalink
docs: fix indentations and chartdata data property
Browse files Browse the repository at this point in the history
  • Loading branch information
uu1t committed Apr 12, 2019
1 parent f64e8b9 commit 3ab05ba
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ export default {
After that you can add your chart component to a parent component

```js
<line-chart :chartdata="chartData" :options="chartOptions"/>
```
<line-chart :chartdata="chartData" :options="chartOptions"/>
```

### Chart with local data

Expand All @@ -302,16 +302,14 @@ export default {
extends: Bar,
data: () => ({
chartdata: {
datacollection: {
labels: ['January', 'February'],
datasets: [
{
label: 'Data One',
backgroundColor: '#f87979',
data: [40, 20]
}
]
}
labels: ['January', 'February'],
datasets: [
{
label: 'Data One',
backgroundColor: '#f87979',
data: [40, 20]
}
]
},
options: {
responsive: true,
Expand All @@ -320,7 +318,7 @@ export default {
}),

mounted () {
this.renderChart(this.datacollection, this.options)
this.renderChart(this.chartdata, this.options)
}
}
```
Expand Down Expand Up @@ -381,13 +379,13 @@ export default {
}),
async mounted () {
this.loaded = false
try {
const { userlist } = await fetch('/api/userlist')
this.chartData = userlist
this.loaded = true
} catch (e) {
console.error(e)
}
try {
const { userlist } = await fetch('/api/userlist')
this.chartdata = userlist
this.loaded = true
} catch (e) {
console.error(e)
}
}
}
</script>
Expand All @@ -403,10 +401,10 @@ You can set `responsive: true` and pass in a styles object which get applied as

```html
<template>
<div>
<line-chart :styles="myStyles"/>
<button @click="increase()">Increase height</button>
</div>
<div>
<line-chart :styles="myStyles"/>
<button @click="increase()">Increase height</button>
</div>
</template>

<script>
Expand Down

0 comments on commit 3ab05ba

Please sign in to comment.