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