Accepted answer

You're using yScale to mean two different things: both bar Y-position (54) and bar height (61). But those values aren't the same for most bars. Change line 61 to something like: return (styles.h-styles.padding - yScale(d[1]));.

Also, using min as the upper bound of the range for yScale doesn't really make sense because that's a data (input) value, not a pixel (output) value. It would make more sense to make that line (22): .range([styles.h-styles.padding, styles.padding])

Related Query

More Query from same tag