kroitor / asciichart

Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
MIT License
1.84k stars 94 forks source link

Specify y-axis min/max hints #48

Closed jamesgpearce closed 4 years ago

jamesgpearce commented 4 years ago

This is for cases when the chart needs a y-axis min smaller than, or a max larger than, the bounds of the series.

For example, it's quite common to want the chart to have a 0 value on the y-axis, regardless of the data. Also being able to specify the max gives the caller a chance to create a range that has 'sensible' rounded tick values on the y-axis.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+1.0%) to 100.0% when pulling 7c72b334521ef55e749ba508187b2adf3688dc66 on jamesgpearce:patch-3 into cc5ddc62d3a1c7995e2c5a8950f30360582eefca on kroitor:master.

jamesgpearce commented 4 years ago

I'll be honest, test.js probably needs a little refactoring ;) - I did just enough to get the coverage up to 100% though