I need your help. I want to change this graph: http://bl.ocks.org/mbostock/3885211 to read from a json file instead of tsv. That is the format of my Json file.
{
"name":"chrome" ,
"values": [
{ "time" : 1232323 , "value:" : 12},
{ "time" : 12323323 , "value:" : 19
]},
{
"counter":"Mozilla" ,
"values": [
{ "time" : 1232sd3 , "value:" : 18},
{ "time" : 11232323 , "value:" : 20}
]},
{
"name":"IE" ,
"values": [
{"time" : 12387823 ,"value:" : 100},
{"time" : 12323 ,"value:" : 123123}
]}
]
I have tried a lot but it does not work with Json file.
Really appreciate your help :(
[at the beginning of the file?JSON.parse()and it will turn the JSON into a Javascript object, then you can do whatever you like with it.[at the beginning and the time value for Mozilla1232sd3is incorrect. It'll raise a parse error. Otherwise, try using JSON.parse(). Look into javascript libraries and frameworks likeYUIandjQueryif you need more tools.