I am having trouble understanding how to transfer the values entered in the input to the graph that is displayed successfully.
Although the update seems correct, nothing changes when I try to update it and the data remains stagnant.
Page.vue
<script>
import PieExample from '../components/PieExample'
export default {
components: {
PieExample,
},
data () {
return {
myMoney: null,
USD: 0,
ETH: 0,
BTC: 0
}
},
methods: {
addMoney() {
this.USD += this.myMoney;
this.ETH += this.myMoney * 0.0003;
this.BTC += this.myMoney * 0.000017;
},
takeMoney() {
this.USD -= this.myMoney;
this.ETH -= this.myMoney * 0.0003;
this.BCT -= this.myMoney * 0.000017;
},
},
}
</script>
PieExample.js
import { Pie } from 'vue-chartjs'
export default {
extends: Pie,
mounted () {
this.renderChart({
labels: ['backs', 'uin', 'Rub'],
datasets: [
{
backgroundColor: [
'#41B883',
'#E46651',
'#00D8FF',
],
data: [1, 1, 1]
}
]
}, {responsive: true, maintainAspectRatio: false})
}
}