Commit 584a5f59 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

clean code

parent 925b5b5e
Pipeline #19269 passed with stages
in 2 minutes and 10 seconds
...@@ -58,21 +58,6 @@ export default { ...@@ -58,21 +58,6 @@ export default {
noGraph: true, noGraph: true,
} }
}, },
watch: {
doughnutData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
hideLegend(val) {
this.updateChartOptions();
},
hideLabels() {
this.updateChartData();
}
},
computed: { computed: {
hideLabelsLabel() { hideLabelsLabel() {
if (Object.entries(this.doughnutData).length == 0) { if (Object.entries(this.doughnutData).length == 0) {
...@@ -138,5 +123,20 @@ export default { ...@@ -138,5 +123,20 @@ export default {
this.myChart.update(); this.myChart.update();
}, },
}, },
watch: {
doughnutData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
hideLegend(val) {
this.updateChartOptions();
},
hideLabels() {
this.updateChartData();
}
},
}; };
</script> </script>
...@@ -32,15 +32,6 @@ export default { ...@@ -32,15 +32,6 @@ export default {
noGraph: true, noGraph: true,
} }
}, },
watch: {
histoData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
},
methods: { methods: {
createChart() { createChart() {
const ctx = document.getElementById(this.chartId); const ctx = document.getElementById(this.chartId);
...@@ -66,5 +57,14 @@ export default { ...@@ -66,5 +57,14 @@ export default {
this.myChart.update(); this.myChart.update();
}, },
}, },
watch: {
histoData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
},
}; };
</script> </script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment