JavaScript

Search for '{{search_term}}'

SVG X

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_x.js

function draw_x() {
    var draw = SVG('draw_x');
    draw.size(200, 200);
    draw.line(0, 0, 200,200).attr({
        'stroke'       : '#FF0000',
        'stroke-width' : '5px'
    });
    draw.line(0, 200, 200,0).attr({
        'stroke'       : '#FF0000',
        'stroke-width' : '5px'
    });
}

draw_x();

Comments

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