Sha256: d8b504493bc33eda178400ddc874da01da45e161ec43653c2f36ae14e9cd29d9
Contents?: true
Size: 1.85 KB
Versions: 6
Compression:
Stored size: 1.85 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{|count| "[#{count.first.to_i * 1000}, #{count.last.to_i}]"}.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
6 entries across 6 versions & 1 rubygems