mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
chore(examples): Update reactive prop examples
This commit is contained in:
@@ -4,17 +4,19 @@ import reactiveData from '../mixins/reactiveData'
|
|||||||
export default {
|
export default {
|
||||||
extends: Bar,
|
extends: Bar,
|
||||||
mixins: [reactiveData],
|
mixins: [reactiveData],
|
||||||
data () {
|
data: () => ({
|
||||||
return {
|
chartData: '',
|
||||||
chartData: ''
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
created () {
|
created () {
|
||||||
this.fillData()
|
this.fillData()
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted () {
|
mounted () {
|
||||||
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
|
this.renderChart(this.chartData, this.options)
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.fillData()
|
this.fillData()
|
||||||
|
|||||||
@@ -4,8 +4,14 @@ import reactiveProp from '../mixins/reactiveProp'
|
|||||||
export default {
|
export default {
|
||||||
extends: Bar,
|
extends: Bar,
|
||||||
mixins: [reactiveProp],
|
mixins: [reactiveProp],
|
||||||
|
data: () => ({
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
mounted () {
|
mounted () {
|
||||||
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false})
|
this.renderChart(this.chartData, this.options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user