Skip to content

Instantly share code, notes, and snippets.

View leonelgalan's full-sized avatar

Leonel Galán leonelgalan

View GitHub Profile
@leonelgalan
leonelgalan / README.md
Last active December 13, 2017 18:38 — forked from mikehadlow/README.md
D3js Graph with X and Y crosshairs, and a threshold line.

Example of a D3js time series graph with X,Y crosshairs and a threshold line. Just copy the drawLineGraph function and call it with your data. The data shoud be an array of two element arrays. Something like:

var data = [
    [new Date(2014, 01, 10), 404],
    [new Date(2014, 01, 11), 123],
    [new Date(2014, 01, 12), 666]
    ];
    
var warnLine = { lineValue: 200, label: 'my important threshold' };