D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
mohhasbias
Full window
Github gist
SVG line using D3
Membuat SVG line elemen dengan menggunakan D3.
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <div id="d3-drawing-area"></div> <script> var svg = d3.select('#d3-drawing-area').append('svg') .attr('width', 300) .attr('height', 300) .style('background', 'lightblue'); var line = svg.append('line') .attr('x1', 100) .attr('y1', 100) .attr('x2', 200) .attr('y2', 200) .style('stroke', 'blue'); </script> </body>
https://d3js.org/d3.v4.min.js