Search for '{{search_term}}'

SVG Line

CMOS is the Code-Maven Open Source podcast that also includes video interviews. Subscribe to this feed RSS feed with your Podcast listener app or via iTunes iTunes.

This is part of the SVG Tutorial and exercises drawing a line in SVG.

examples/js/svg_line.js

function draw_line() {
    var draw = SVG('line_1');
    draw.size(200, 100);
    draw.line(0, 0, 100, 70).attr({
        'stroke'       : '#FF0000',
        'stroke-width' : '3px'
    });
}

draw_line();

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus