quantumpotato quantumpotato - 1 year ago 825
HTML Question

d3 layout is undefined

Trying to use d3.js and not sure how to reference it properly:


!DOCTYPE html>
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery-1.7.1.js"></script>
<<<<other scripts>>>
<script src="topbar.js"></script>
$(function() {
var n = 4, // number of layers
m = 64, // number of samples per layer
data = d3.layout.stack()(stream_layers(n, m, .1)),
color = d3.interpolateRgb("#aad", "#556");

Answer Source

Ad following line in your page.

<script type="text/javascript" src="your respective directory/d3.js"></script>

Now you can use any property or function in your page from d3.js

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download