javascript - Simple D3.js line chart with data that are values collect every hours -
i'm newbie on d3.js , need produce simple line chart using values collected every hours
i'm trying use d3.js sample ...
http://bl.ocks.org/d3noob/b3ff6ae1c120eea654b5
... , adapt data this
6/28/2016-10:2:0,24.3 6/28/2016-9:2:0,23.2 6/28/2016-8:2:0,22.2 6/28/2016-7:2:0,21.5 6/28/2016-6:2:0,21.2 6/28/2016-5:2:0,20.8 6/28/2016-4:2:0,21.6 6/28/2016-3:2:0,21.6 6/28/2016-2:2:0,22.0 6/28/2016-1:2:0,22.4 6/28/2016-0:2:0,23.3 6/27/2016-23:2:0,25.0 6/27/2016-22:2:0,25.4 6/27/2016-21:2:0,27.0
where 6/28/2016-10:2:0 time (mm/dd/yyyy-hh:mm:sec) , 24.3 value i'd plot (note can modify structure if needed ...)
how may set time format in case, how i've modify following lines?
// parse date / time var parsedate = d3.time.format("%d-%b-%y").parse;
are these lines i've modify replicate sample code data?
any samples / suggestion?
sorry entry-level question, hope after move next steps in more independent way!!!
cesare
replacing data in data.csv in example data should work. d3 scale , plot values on graph itself. if want change x-scale , want include time well, have change format specifier in same line have mentioned line:
var parsedate = d3.time.format("%d-%b-%y").parse;
to line:
var parsedate = d3.time.format("%m/%d/%y-%h:%m:%s").parse;
i have added sample code, check out: line chart date , time.
Comments
Post a Comment