From 6ffd676182ad71f8569b8eff877d5d7a4e4188d3 Mon Sep 17 00:00:00 2001 From: chiayin Date: Fri, 6 Oct 2023 12:31:26 +0800 Subject: [PATCH] Issue #132: Done. --- src/components/Discover/Map/Filter/Trace.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Discover/Map/Filter/Trace.vue b/src/components/Discover/Map/Filter/Trace.vue index ca497a0..194cd8d 100644 --- a/src/components/Discover/Map/Filter/Trace.vue +++ b/src/components/Discover/Map/Filter/Trace.vue @@ -113,7 +113,7 @@ export default { }, chartData: function() { const start = this.selectArea[0]; - const end = this.selectArea[1]-1; + const end = this.selectArea[1] - 1; const labels = this.traces.map(trace => `#${trace.id}`); const data = this.traces.map(trace => this.getPercentLabel(trace.count / this.traceCountTotal)); const selectAreaData = this.traces.map((trace, index) => index >= start && index <= end ? 'rgba(0,153,255)' : 'rgba(203, 213, 225)'); @@ -132,6 +132,12 @@ export default { }; } }, + watch: { + selectArea: function(newValue) { + let roundValue = Math.round(newValue[1].toFixed()); + if(newValue[1] !== roundValue) this.selectArea[1] = roundValue; + } + }, methods: { /** * Set bar chart Options