Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: svg is not defined #42

Open
cancan101 opened this issue Oct 29, 2014 · 1 comment
Open

Uncaught ReferenceError: svg is not defined #42

cancan101 opened this issue Oct 29, 2014 · 1 comment

Comments

@cancan101
Copy link
Contributor

Here:

@rrnovaesjr
Copy link

Try creating a svg element in your script, like this:

var svg = d3.select('body').append('svg').attr("width", "100%").attr("height", "500px"); svg.selectAll().data(data).enter().append("circle") .attr("cx", function(d) { return d.x; }) .attr("cy", function(d) { return d.y; }) .attr("r", 2.5) .attr("fill", "black");

Note that data is an array of {x: 0, y: 0} objects. You can use your creativity to set up the properties of your svg chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants