var Tablechart;(function(a){var c=0;function b(){c++;return"jQ-uid-"+c}a.fn.tablechart=function(d){var d=a.extend(true,{},a.fn.tablechart.defaults,d);this.each(function(f){var e=a(this).data("tablechart")||{},g=a.extend(true,{},d);if(e[d.chartName]==undefined){e[d.chartName]=new Tablechart(this,g)}e[d.chartName].plot();a(this).data("tablechart",e)});return this};Tablechart=function(d,e){this.options=e;this.el=d;this.chart_id="chart-"+b();this.data=[];this.chart=this.create()};Tablechart.prototype.create=function(){var d=a('
').attr("id",this.chart_id).insertAfter(a(this.el));if(this.options.height){d.height(this.options.height)}d.css("width","100%");d.wrap('
')};Tablechart.prototype.plot=function(){this.offset=0;tablechart=this;if(!a.nodeName(this.el,"table")){a("table",this.el).each(function(){tablechart.scrape(this)})}else{tablechart.scrape(this.el)}if(this.chart){this.chart.destroy()}this.chart=a.jqplot(this.chart_id,this.data,this.options.plotOptions)};Tablechart.prototype.scrape=function(g){var h=this,f=this.options,e=this.offset,d=this.data;a(g).find("thead th:gt(0)").each(function(k){var l=e+k,j={};if(f.parseOptions){j=Tablechart.replaceOptions(a(this).data("seriesoptions"))}f.plotOptions.series[l]=a.extend({label:a(this).text()},f.plotOptions.series[l],j)});a(g).find("tbody tr").each(function(j){var k=0,l=0;a(this).find("th").each(function(){k=f.parseX.call(h,this)});a(this).find("td").each(function(m){var i=e+m;if(j==0){d[i]=[]}l=f.parseY.call(h,this);d[i].push([k,l])})});this.offset=d.length};Tablechart.parseText=function(d){return a(d).text()};Tablechart.parseFloat=function(d){return parseFloat(a(d).text())};Tablechart.REPLACE=["renderer","markerRenderer","labelRenderer","parseX","parseY","scrapeSingle","scrapeMultiple","tickRenderer","processSeries","formatter","tooltipContentEditor"];Tablechart.replaceOptions=function(d){if(!d){return d}a.each(d,function(f,g){if(typeof g=="object"){d[f]=Tablechart.replaceOptions(g)}else{if(typeof g=="string"&&a.inArray(f,Tablechart.REPLACE)>-1){namespaces=g.split(".");func=namespaces.pop();context=window;for(var e=0;e