Skip to content

Commit b6c5cce

Browse files
authored
Merge pull request #498 from plsdev89/fix/chart-smoothing-overshoot
Fix chart smoothing overshoot
2 parents d0a9030 + ad0e8a2 commit b6c5cce

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/DailyCodingTimeChart/DailyCodingTimeChart.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ export const DailyCodingTimeChart = ({
110110
borderColor: "#1f78b4",
111111
borderWidth: 4,
112112
pointRadius: 2,
113+
// Avoid "overshoot" where the smoothed curve goes above/below actual points.
114+
cubicInterpolationMode: smoothCharts ? "monotone" : "default",
113115
tension: smoothCharts ? 0.5 : 0,
114116
},
115117
],

src/components/MonthlyCodingTimeChart/MonthlyCodingTimeChart.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export const MonthlyCodingTimeChart = ({
120120
borderColor: "#1f78b4",
121121
borderWidth: 4,
122122
pointRadius: 2,
123+
// Avoid "overshoot" where the smoothed curve goes above/below actual points.
124+
cubicInterpolationMode: smoothCharts ? "monotone" : "default",
123125
tension: smoothCharts ? 0.5 : 0,
124126
},
125127
],

0 commit comments

Comments
 (0)