dandehavilland / mg-line-brushing

A stepwise brushing extension for line charts in metrics-graphics.
MIT License
29 stars 10 forks source link

10% padding for y-axis does not work with negative values #5

Open Crazywater opened 9 years ago

Crazywater commented 9 years ago

Hi! I've found a small bug in here: https://github.com/dandehavilland/mg-line-brushing/blob/master/src/js/hooks.js#L199 I think multiplying by 0.9 and 1.1 does not work with negative values, a part of the graph is cut out of the picture. How about computing the difference between yBounds[1] and yBounds[0] and adding/subtracting 0.1 times that?