asciiplot
Console ASCII line charts in pure Javascript (for NodeJS) with no dependencies (clone of asciichart). This code is absolutely free for any usage, you just do whatever you want.
Usage
NodeJS
npm install asciiplot
var asciiplot = var s0 = 120for var i = 0; i < s0length; i++ s0i = 15 * Mathconsole
Options
The width of the chart will always equal the length of data series. The height and range are determined automatically.
var s0 = 120for var i = 0; i < s0length; i++ s0i = 15 * Mathconsole
The output can be configured by passing a second parameter to the plot (series, config)
function. The following options are supported:
var config = offset: 3 // axis offset from the left (min 2) padding: ' ' // padding string for label formatting (can be overrided) height: 10 // any height you want // the label format function applies default padding { return padding + x }
Scale To Desired Height
var s = for var i = 0; i < 120; i++ si = 15 * Math // values range from -15 to +15console // this rescales the graph to ±3 lines
Auto-range
var s2 = 120s20 = Mathfor i = 1; i < s2length; i++ s2i = s2i - 1 + Mathconsole