(function($) { $(function() { $.get("../", function(data) { $.each(data, function( i, avg ) { var $table = $( "#" + avg.point + "[data-pathname='" + avg.pathname + "']"); if( !$table.length ) { $table = $( "", { id: avg.point, "data-pathname": avg.pathname }); $table.append( ""); $table.append( "" ); $table.append( "" ); } // TODO assume time ordering in the data set var $heading = $table.find("thead > tr > th:contains(" + avg.day + ")"); if( !$heading.length ) { $heading = $("" ); $("#tables").append($table); }); $("#tables table").visualize({ type: "line", width: 400, height: 400 }).appendTo("#graphs"); }); }); })(jQuery);
" + avg.point + " " + avg.pathname + "
", { text: avg.day, scope: "column" }); $table.find("thead > tr").append($heading); } var $rowHeading = $table.find("tbody > tr > th:contains(" + avg.point + ")" ), $row = $table.find( "tbody > tr" ); if( !$rowHeading.length ) { $rowHeading = $("", { text: avg.point, scope: "row" }); $row.append( $rowHeading ); } $row.append( "" + avg.avg_value + "