Widget:JqPlotFromTable

This is a test of making a widget that uses jqPlot a pure javascript plotting package. /*<![CDATA[*/ $(function { var deps = ["http://b.oer.me/js/jqplot/jquery.jqplot.min.js",    "http://b.oer.me/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js",    "http://b.oer.me/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"];  $('head').append('');  function doPlot {    $.getScript(deps.shift, function { if (deps.length) { doPlot; } else { var cn = ''; var $cID = $('#' + cn); $cID.html(' '); var myArray=[]; var tn = ''; var xCol = ''; var yCol = ''; var tID = '#'+ tn; var sl = ''; var showMyLine = sl; $(function{            $(tID + ' tr:has(td)').each(function { var xData = $(this).find('td').eq(xCol).html; var yData = $(this).find('td').eq(yCol).html; if ((xData != null ) && (yData != null )) myArray.push([parseFloat(xData), parseFloat(yData)]); });            var xLabel=$(tID + ' tr:has(th)').find('th').eq(xCol).html;             var yLabel=$(tID + ' tr:has(th)').find('th').eq(yCol).html;             var plot1 = $.jqplot(cn, [myArray],{ title:"""Test jqPlot", axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer}, series:[{ showLine: showMyLine, markerOptions: { style:"", size: } }], axes: { xaxis: { label: xLabel}, yaxis: { label: yLabel}  } });        }); }   });  }  doPlot; }); /*]]>*/