0.1.2 • Published 11 years ago

chart v0.1.2

Weekly downloads
2,318
License
-
Repository
github
Last release
11 years ago

node-chart

Time Series Charting Canvas API

Use

var chart = new Chart();
var ee = require('events').EventEmitter;
var datasource = new ee;

chart.series(datasource);
chart.to(document.getElementById('mychart'));

setInterval(function() {
    var random = Math.floor(Math.random()*100);
    datasource.emit('data',{y:random});
},1000);

Multiple Data sources

var d1 = new ee;
var d2 = new ee;

chart.series(d1);
chart.series(d2);

// or
chart.series([d1,d2])
    
// or
chart.series(d1,d2);

chart.series

Event types that chart.series responds to are

'data' - provides data for timeseries and optional labels

'stop' - stops the timeseries for that datastream

chart.legend

<canvas id='legend'></canvas>
chart.legend(document.getElementById('legend'));

Legend is automatically created with the data that is sent. To visualize and interact with a legend, use the .legend callback

Labels go with the value

datasorce.emit('data',{'units sold':9.2})

You can supply multiple labels

datasorce1.emit('data',{'units sold':9.2})
datasorce2.emit('data',{'current energy consumption':30})

Tests

// to install tap, simply npm install tap

tap ./test

MISC

Author: David Wee rook2pawn@gmail.com License: MIT Developed At : Malhar, Inc. david@malhar-inc.com

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.19

11 years ago

0.0.18

11 years ago

0.0.16

11 years ago

0.0.15

11 years ago

0.0.14

11 years ago

0.0.13

11 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago