Sha256: 808d9f548e4b44b21090c1bcb81b30297f1539099d24b1eb46d9e766bcd00afb
Contents?: true
Size: 1.82 KB
Versions: 3
Compression:
Stored size: 1.82 KB
Contents
<% if @field %> <%= partial(:left )%> <div id='right'> <% if @id %> <h1><a href='/fields/<%= @field %>'><%= humanize @field %></a> » <%= humanize @id %></h1> <% elsif @query %> <h1>Search » <%= humanize @query %></h1> <% end %> <% else %> <h1>Total Requests</h1> <% end %> <% if @counts.empty? %> <h2>No requests found.</h2> <% else %> <div id='graph'></div> <script type='text/javascript'> $.plot($("#graph"), [{ data: [ <%= @counts.collect{|k,v| "[#{k * 1000}, #{v}]"}.join(',') %> ], label: 'requests' }], { series: { lines: { show: true }, points: { show: true } }, grid: { hoverable: true }, xaxis: { mode: "time", timeformat: "%m/%d\n%h:%M", autoscaleMargin: 0.01 }, yaxis: { autoscaleMargin: 0.01 }, legend: { show: false }, colors: ["#6bc2f6", "#d18b2c", "#dba255", "#919733"] }); var previousPoint = null; $("#graph").bind("plothover", function (event, pos, item) { if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#tooltip").remove(); var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2), date = new Date( ); date.setTime(x); date = date.toUTCString(); showTooltip(item.pageX, item.pageY, Math.round(y) + ' ' + item.series.label + ' at ' + date); } } else { $("#tooltip").remove(); previousPoint = null; } }); </script> <% end %> <% if @field %></div><% end %>
Version data entries
3 entries across 3 versions & 1 rubygems