javascript - how to disable sorting data in x axis in d3 line chart? -
i want show line graph example link .my data json this.
[ { "timestamp": "23:33:58", "usage": 90 }, { "timestamp": "00:04:03", "usage": 94 }, { "timestamp": "00:54:04", "usage": 82 }, { "timestamp": "01:04:00", "usage": 100 }, { "timestamp": "01:34:02", "usage": 97 } ]
but x axis didn't start 23:33:58.it start 00:00:00 mean 12.00 , draw in 23:59:00.so not requirement .i want solve problem please guide me.
you can pass timestamp
date can solve problem.then identify date , time.so can solve this.in example parse timestamp this.
var parsetime = d3.time.format("%y-%m-%d %h:%m:%s").parse;
then json format timestamp change this
"timestamp": "2011-01-01 23:33:58"
then think can solve it.
Comments
Post a Comment