jquery

Jquery HTML Graph

A small code snippet for drawing a pure HTML graph using Jquey

   var points = {0.3,0.5,0.9,0.7};
   htmlgraph(points);
 
    function htmlgraph(points){
        var str = "";
        for (var i = 0; i < points.length; i++) {
            var ioid = 'io'+i;
            var x = i*(100/points.length);
            var y = points[i]*100+10;
            var css = 'border:1px solid red;left:'+x+'%;top:'+y+'%;width:1px;height:1px;position:absolute;';
            var mystr = '<div class="p" id="'+ioid+'" style="'+css+'"></div>';
            str += mystr;
        }
 
info@theanthillsocial.co.uk XHTML 1.0 Strict CSS2 WAI