Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/graph-types/polyline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export default function polyline(chart: Chart) {
const yRange = chart.meta.yScale.range()
let yMax = yRange[0]
let yMin = yRange[1]

// Fix #342
// When yAxis is reversed, the yRange is inverted, i.e. yMin > yMax
if (yMin > yMax) [yMin, yMax] = [yMax, yMin]

// workaround, clamp assuming that the bounds are finite but huge
const diff = yMax - yMin
yMax += diff * 1e6
Expand Down
Loading