Skip to content

Commit 6fa11f4

Browse files
authored
Merge pull request #500 from plsdev89/fix/499-chart-vertex-spikes
Fix chart vertex spikes when smooth charts are disabled
2 parents c5d7b92 + bac5aef commit 6fa11f4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/components/DailyCodingTimeChart/DailyCodingTimeChart.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ export const DailyCodingTimeChart = ({
109109
data: data.map((entry) => entry.duration),
110110
borderColor: "#1f78b4",
111111
borderWidth: 4,
112+
// Avoid sharp "miter" spikes at vertices when drawing straight segments.
113+
borderJoinStyle: "round",
114+
borderCapStyle: "round",
112115
pointRadius: 2,
113116
// Avoid "overshoot" where the smoothed curve goes above/below actual points.
114117
cubicInterpolationMode: smoothCharts ? "monotone" : "default",

src/components/MonthlyCodingTimeChart/MonthlyCodingTimeChart.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export const MonthlyCodingTimeChart = ({
119119
data: data.map((entry) => entry.duration),
120120
borderColor: "#1f78b4",
121121
borderWidth: 4,
122+
// Avoid sharp "miter" spikes at vertices when drawing straight segments.
123+
borderJoinStyle: "round",
124+
borderCapStyle: "round",
122125
pointRadius: 2,
123126
// Avoid "overshoot" where the smoothed curve goes above/below actual points.
124127
cubicInterpolationMode: smoothCharts ? "monotone" : "default",

0 commit comments

Comments
 (0)