Skip to content

Instantly share code, notes, and snippets.

@mohhasbias mohhasbias/.block

Last active Feb 26, 2017
What would you like to do?
SVG line using D3
license: mit

Membuat SVG line elemen dengan menggunakan D3.

<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
<div id="d3-drawing-area"></div>
var svg ='#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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.