score:2

Accepted answer

You are trying to include the library in the script tag that contains your code. Try to use this instead:

<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
   // your code here
</script>

score:0

Create another script tag inside body tag, and call the function from that script tag. i.e.

<script>
function generateGraph() {
// function definition 
}
</script>

<body>
<script>
generateGraph();
</script>
</body>

Related Query

More Query from same tag