Hi i have this variable myJSON that i want to use in my d3 force graph this is the output of the variable. i was wondering if there any way to use a variable to populate my graph.
var myJSON;
$.ajax({
type: "POST",
url: "http://localhost/web/search.php",
async: false,
data: {
"dataA": string2
},
cache: false,
success: function(data) {
myJSON = JSON.parse(data);
},
});
By just putting the variable into the graphs code but it keeps giving me this error uncaught exception: [object ProgressEvent] does any one know why isnt this working? any suggestion would be appreciated.
d3.json("myJSON", function(error, graph) { if (error) throw error;


d3.json("http://localhost/web/search.php", function(error, data) { console.log(data); // this is your data });You shouldn't need to ajax it in first. D3 will load it for you.