A bar graph that displays information in real time using canvas.
Check out the live demo on CodePen, which uses the stand-alone files.
Ensure component(1) is installed, then:
$ component install tanem/skyline
This library may be used stand-alone without the component tool. To build the stand-alone files, ensure UglifyJS2 is installed, then:
$ make standalone
Then add ./standalone/skyline.css and ./standalone/skyline.js to your application and reference the Skyline
global.
To run the unit tests, ensure testling is installed. Then:
$ make test
Initialize a new Skyline
.
Set the bar spacing.
skyline.barSpacing(3)
Set the bar width.
skyline.barSpacing(5)
Set the gutter.
skyline.gutter(50)
Set the width.
skyline.width(600)
Set the height.
skyline.height(300)
Set the background bar colour.
skyline.backgroundBarColour('#dedede')
Set the history bar colour.
skyline.historyBarColour('#ababab')
Set the axes font.
skyline.axesFont('14px sans-serif')
Set the frame rate (fps).
skyline.frameRate(30)
Add a hit to the graph.
skyline.addHit()
Start the graph animation.
skyline.start()