Issue #132: Done.

This commit is contained in:
chiayin
2023-10-06 12:31:26 +08:00
parent 6bd92dfef3
commit 6ffd676182

View File

@@ -113,7 +113,7 @@ export default {
}, },
chartData: function() { chartData: function() {
const start = this.selectArea[0]; 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 labels = this.traces.map(trace => `#${trace.id}`);
const data = this.traces.map(trace => this.getPercentLabel(trace.count / this.traceCountTotal)); 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)'); 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: { methods: {
/** /**
* Set bar chart Options * Set bar chart Options