diff --git a/src/CreateGraphPath.ts b/src/CreateGraphPath.ts index 67e9a2e..260a9ec 100644 --- a/src/CreateGraphPath.ts +++ b/src/CreateGraphPath.ts @@ -101,6 +101,8 @@ export const getYPositionInRange = ( value: number, yRange: GraphYRange ): number => { + if (yRange.min === yRange.max) return 0.5 // Prevent division by zero (NaN) + const diff = yRange.max - yRange.min const y = value