fix: Issues #222 done.

This commit is contained in:
chiayin
2024-03-07 17:34:19 +08:00
parent e8dc258c12
commit e28aaf9cce
2 changed files with 28 additions and 1 deletions

View File

@@ -184,7 +184,7 @@ import ConformanceStore from '@/stores/conformance.js';
import iconNA from '@/components/icons/IconNA.vue';
import MoreModal from './MoreModal.vue';
import getNumberLabel from '@/module/numberLabel.js';
import { setLineChartData, setBarChartData, timeRange, yTimeRange, getXIndex, formatTime } from '@/module/setChartData.js';
import { setLineChartData, setBarChartData, timeRange, yTimeRange, getXIndex, formatTime, formatMaxTwo } from '@/module/setChartData.js';
import shortScaleNumber from '@/module/shortScaleNumber.js';
import getMoment from 'moment';
@@ -617,6 +617,7 @@ export default {
let yVal = yTimeRange(data, 100, yMin, yMax);
data = xVal.map((x, index) => ({ x, y: yVal[index] }));
let formattedXVal = xVal.map(value => formatTime(value));
formattedXVal = formatMaxTwo(formattedXVal);
let selectTimeMinIndex = getXIndex(xVal, this.selectDurationTime.min);
let selectTimeMaxIndex = getXIndex(xVal, this.selectDurationTime.max);
const start = selectTimeMinIndex;
@@ -624,6 +625,8 @@ export default {
const inside = (ctx, value) => ctx.p0DataIndex >= start && ctx.p1DataIndex <= end ? value : undefined;
const outside = (ctx, value) => ctx.p0DataIndex < start || ctx.p1DataIndex > end ? value : undefined;
// console.log(formattedXVal);
this.timeChartData = {
labels: formattedXVal,
datasets: [