<% if @paginated_builds.any? %>
  <div class="metrics">

    <div class="date-usage">
      <h3>Usage by Date</h3>
      <%= line_chart @paginated_builds.group_by_day(:initiated_at).count %>
    </div>

    <% if params[:result].blank? %>
      <div class="results">
        <h3>Results</h3>
        <%= pie_chart [['Success', @paginated_builds.where(:result => 'SUCCESS').count], ['Failure', @paginated_builds.where(:result => 'FAILURE').count]], colors: ['green', 'red'] %>
      </div>
    <% end %>
  </div>
<% end %>
