From 85ed1f84b7c07044d153a80c56cd03af7a26eb47 Mon Sep 17 00:00:00 2001 From: chiayin Date: Tue, 16 May 2023 11:17:08 +0800 Subject: [PATCH] Discover: SidebarFilter Trace Slider control to table and chart done. --- src/components/Discover/Filter/Trace.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/Discover/Filter/Trace.vue b/src/components/Discover/Filter/Trace.vue index 66bcb27..82bbead 100644 --- a/src/components/Discover/Filter/Trace.vue +++ b/src/components/Discover/Filter/Trace.vue @@ -10,10 +10,9 @@

Select percentage of case {{ caseTotalPercent }}%

- +
- -

{{ this.traces.map(trace => this.getPercentLabel(trace.ratio)).slice(this.selectArea[0]-1, this.selectArea[1]) }} +

{{ this.traces.map(trace => this.getPercentLabel(trace.ratio)).slice(this.selectArea[0], this.selectArea[1]) }}
{{ selectArea }} @@ -47,7 +46,7 @@ -
+

Trace #{{ showTraceId }}

@@ -85,7 +84,7 @@ export default { }, showTraceId: null, chartOptions: null, - selectArea: [1, 2] + selectArea: [0, 1] } }, computed: { @@ -101,7 +100,7 @@ export default { ratio: this.getPercentLabel(trace.ratio), }; }).sort((x, y) => x.id - y.id) - .slice(this.selectArea[0]-1, this.selectArea[1]); + .slice(this.selectArea[0], this.selectArea[1]); }, caseTotalPercent: function() { let sum = 0; @@ -113,7 +112,7 @@ export default { return lastDigit === '0' ? sum.toFixed(0) : sum.toFixed(1) }, chartData: function() { - const start = this.selectArea[0]-1; + const start = this.selectArea[0]; const end = this.selectArea[1]-1; let selectAreaData = this.traces.map((trace, index) => index >= start && index<= end ? 'rgba(0,153,255)' : 'rgba(203, 213, 225)'); @@ -336,7 +335,7 @@ export default { this.chartOptions = this.barOptions(); // this.chartData = this.setChartData(); // this.chartOptions = this.setChartOptions(); - this.selectArea = [1, this.traceTotal] + this.selectArea = [0, this.traceTotal] }, }