Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
apertureless committed May 29, 2019
2 parents e771ea2 + aef7c62 commit 52ebb34
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 33 deletions.
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ module.exports = {
}
},
}
},
algolia: {
indexName: 'vue-chartjs',
apiKey: 'b3544f7387612693644777553675d56a'
}
},
locales: {
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
2 changes: 1 addition & 1 deletion docs/fr-fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
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
2 changes: 1 addition & 1 deletion docs/id/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
2 changes: 1 addition & 1 deletion docs/ja/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
home: true
heroImage: /vue-chartjs.png
actionText: 初めに →
actionLink: /guide/
actionLink: /ja/guide/
features:
- title: 簡単
details: 初心者にもプロにも簡単に始められる 🙌
Expand Down
2 changes: 1 addition & 1 deletion docs/pt-br/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
2 changes: 1 addition & 1 deletion docs/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
2 changes: 1 addition & 1 deletion docs/zh-cn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerfull
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
---
5 changes: 3 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BaseChart } from './components'
import { ReactiveDataMixin, ReactivePropMixin } from './mixins'

declare module 'vue-chartjs' {
export function generateChart(chartId: string, chartType: string): any;
Expand All @@ -12,8 +13,8 @@ declare module 'vue-chartjs' {
export class Bubble extends BaseChart {}
export class Scatter extends BaseChart {}
export const mixins: {
reactiveData: any
reactiveProp: any
reactiveData: typeof ReactiveDataMixin
reactiveProp: typeof ReactivePropMixin
}
}

9 changes: 9 additions & 0 deletions types/mixins.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Vue from 'vue'

export declare class ReactiveDataMixin extends Vue {
chartData: any;
}

export declare class ReactivePropMixin extends Vue {
readonly chartData: any;
}

0 comments on commit 52ebb34

Please sign in to comment.