aPoint = data.find(
            (d) =>
              Math.abs(new Date(d.timestamp) - currentSlot.timestamp) <
              intervalMillis / 2,
          );

          if (matchingDataPoint) {
            currentSlot.value = matchingDataPoint.value;
          } else {
            // Find the two closest data points for interpolation
            const previousData = data
              .filter((d) => new Date(d.timestamp) < currentSlot.timestamp)
              .pop();
            const nextData = data.find(
