Conformance: fix Time Trend conformance chart blue color done.

This commit is contained in:
chiayin
2023-09-04 11:32:25 +08:00
parent f68eafca71
commit 60182c3148
2 changed files with 3 additions and 3 deletions

View File

@@ -142,10 +142,10 @@ export function getXIndex(data, xValue) {
let closestIndex = xValue; // 假定第一个元素的索引是 0
let smallestDifference = Math.abs(xValue - data[0]); // 初始差值设为第一个元素与目标数的差值
for (let i = 1; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
let difference = Math.abs(xValue - data[i]);
if (difference < smallestDifference) {
if (difference <= smallestDifference) {
closestElement = data[i];
closestIndex = i;
smallestDifference = difference;