(function($) { $(function() { $.get("../", function(data) { $.each(data, function( i, avg ) { var $table = $( "#" + avg.point + "[data-pathname='" + avg.pathname + "']"); if( !$table.length ) { $table = $( "
| ", { 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 + " | " ); $("#tables").append($table); }); $("#tables table").visualize({ type: "line", width: 400, height: 400 }).appendTo("#graphs"); }); }); })(jQuery);
|---|