<h3>Reports by hour</h3>

<div class="btn-group" style="float:right">
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Action <span class="caret"></span>
  </button>
  <ul class="dropdown-menu">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">Separated link</a></li>
  </ul>
</div>

<%= line_chart Post.where("created_at >= :date", :date => 1.week.ago).group_by_hour(:created_at).count %>

<h3>Reports by hour</h3>

<%= line_chart Post.where("created_at >= :date", :date => 1.week.ago).group_by_hour(:created_at).count %>

<h3>Reports by site</h3>

<%= pie_chart Post.all.group(:site).count.map{ |k,v| {(k.nil? ? "Unknown" : CGI.unescape(k.site_name))=>v} }.reduce(:merge).select{|k,v| k != "Unknown"}.sort_by {|k,v| v}.reverse %>

Add global site pie chart
Add global site pie chart
