Package: asciichartpy
asciichartConsole ASCII line charts in pure Javascript (for NodeJS and browsers) with no dependencies. This code is absolutely free for any usage, you just do whatever the fuck you want.UsageNodeJSnpminstallasciichartvarasciichart=require('asciichart')vars0=newArray(120)for(vari=0;i<s0.length;i++)s0[i]=15*Math.sin(i*((Math.PI*4)/s0.length))console.log(asciichart.plot(s0))Browsers<!DOCTYPE html><html><head><metahttp-equiv="Content-Type"content="text/html; charset=utf-8"><metacharset="UTF-8"><title>asciichart</title><scriptsrc="asciichart.js"></script><scripttype="text/javascript">vars0=newArray(120)for(vari=0;i<s0.length;i++)s0[i]=15*Math.sin(i*((Math.PI*4)/s0.length))console.log(asciichart.plot(s0))</script></head><body></body></html>OptionsThe width of the chart will always equal the length of data series. The height and range are determined automatically.vars0=newArray(120)for(vari=0;i<s0.length;i++)s0[i]=15*Math.sin(i*((Math.PI*4)/s0.length))console.log(asciichart.plot(s0))The output can be configured by passing a second parameter to theplot (series, config)function. The following options are supported:varconfig={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 paddingformat:function(x,i){return(padding+x.toFixed(2)).slice(-padding.length)}}Scale To Desired Heightvars=[]for(vari=0;i<120;i++)s[i]=15*Math.cos(i*((Math.PI*8)/120))// values range from -15 to +15console.log(asciichart.plot(s,{height:6}))// this rescales the graph to ±3 linesAuto-rangevars2=newArray(120)s2[0]=Math.round(Math.random()*15)for(i=1;i<s2.length;i++)s2[i]=s2[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))console.log(asciichart.plot(s2))Multiple Seriesvars2=newArray(120)s2[0]=Math.round(Math.random()*15)for(i=1;i<s2.length;i++)s2[i]=s2[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))vars3=newArray(120)s3[0]=Math.round(Math.random()*15)for(i=1;i<s3.length;i++)s3[i]=s3[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))console.log(asciichart.plot([s2,s3]))Colorsvararr1=newArray(120)arr1[0]=Math.round(Math.random()*15)for(i=1;i<arr1.length;i++)arr1[i]=arr1[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))vararr2=newArray(120)arr2[0]=Math.round(Math.random()*15)for(i=1;i<arr2.length;i++)arr2[i]=arr2[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))vararr3=newArray(120)arr3[0]=Math.round(Math.random()*15)for(i=1;i<arr3.length;i++)arr3[i]=arr3[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))vararr4=newArray(120)arr4[0]=Math.round(Math.random()*15)for(i=1;i<arr4.length;i++)arr4[i]=arr4[i-1]+Math.round(Math.random()*(Math.random()>0.5?2:-2))varconfig={colors:[asciichart.blue,asciichart.green,asciichart.default,// default colorundefined,// equivalent to default]}console.log(asciichart.plot([arr1,arr2,arr3,arr4],config))See AlsoA util bymadnightfor drawing Bitcoin/Ether/altcoin charts in command-line console:bitcoin-chart-cli.PortsSpecial thx to all who helped port it to other languages, great stuff!Python portincluded!Java:ASCIIGraph, ported byMitchTalmadge. If you're a Java-person, check it out!Go:asciigraph, ported byguptarohit, Go people! )Haskell:asciichart, ported bymadnightto Haskell world!Ruby:ascii_chart, ported byzhustec!Elixir:asciichart, ported bysndv!Perl:App::AsciiChart, ported byvti!C:plot, ported byannacrombiewith a ruby extension!R:asciichartr, ported byblmayer!Rust:rasciigraph, ported byorhanbalci!PHP:PHP-colored-ascii-linechart, ported bynoximo!C#:asciichart-sharp, ported bysamcarton!Future work (coming soon, hopefully)levels and points on the graph!even better value formatting and auto-scaling!