0

I am using d3 to plot graphs. Below method works absolutely fine for IE10+, Chrome and Firefox but on IE9, it throws javascript error that "SCRIPT5007: Unable to get property 'nodes' of undefined or null"

In my view, workaround will be to send json data directly to the call rather than accessing json file through URL and then creating graph in callback.

If anyone knows any solution for IE9, please let me know.

d3.json(url, function (error, graph) {
        force
        .nodes(graph.nodes)
        .links(graph.links)
        .start();
...
}
A.G.
  • 734
  • 2
  • 8
  • 27

1 Answers1

0

I think it's related to the compatibility mode of IE9, try adding this to your header

<meta http-equiv="X-UA-Compatible" content="IE=edge" >

See this answer https://stackoverflow.com/a/5787944/263989 for a better explanation

Community
  • 1
  • 1
fasouto
  • 4,386
  • 3
  • 30
  • 66
  • 1
    It solves the issue but it leads to some other issues :) I preferred the second fail safe approach to provide json data directly to d3 instead of path. Anyways, I will accept this as answer. – A.G. Mar 26 '14 at 13:30