D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
giacomofer
Full window
Github gist
prova_scatterplot
Built with
blockbuilder.org
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>D3_Example_Scatter_Plot</title> <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> </head> <style> circle{fill: #00ff00} </style> <body> <script> var svg = d3.select("body").append("svg") .attr("width", 250) .attr("height", 250); function a_name (d){ // Bind data var circles = svg.selectAll("circle").data(d); // Enter circles.enter().append("circle") .attr("r", 7); // Update circles .attr("cx", function (d){ return d.x; }) .attr("cy", function (d){ return d.y; }); // Exit circles.exit().remove(); } d3.csv("https://gist.githubusercontent.com/giacomofer/d9ffae991f7be3a9637365e7a54d996b/raw/464e2872d853316820b1ddb856f1a7511b204837/test", function (d){a_name(d);}); </script> </body> </html>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js