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 {
noGraph: true,
}
},
watch: {
doughnutData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
hideLegend(val) {
this.updateChartOptions();
},
hideLabels() {
this.updateChartData();
}
},
computed: {
hideLabelsLabel() {
if (Object.entries(this.doughnutData).length == 0) {
......@@ -138,5 +123,20 @@ export default {
this.myChart.update();
},
},
watch: {
doughnutData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
hideLegend(val) {
this.updateChartOptions();
},
hideLabels() {
this.updateChartData();
}
},
};
</script>
......@@ -32,15 +32,6 @@ export default {
noGraph: true,
}
},
watch: {
histoData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
},
methods: {
createChart() {
const ctx = document.getElementById(this.chartId);
......@@ -66,5 +57,14 @@ export default {
this.myChart.update();
},
},
watch: {
histoData(val) {
if (this.noGraph) {
this.noGraph = false;
this.createChart();
}
this.updateChart();
},
},
};
</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