UNC-Libraries/hy-c

View on GitHub
app/views/hyrax/stats/_downloads.html.erb

Summary

Maintainability
Test Coverage
<%# [hyc-override] Changing the stats period from a month to a year %>
<%# https://github.com/samvera/hyrax/blob/hyrax-v3.5.0/app/views/hyrax/stats/_downloads.html.erb %>
<script>
  Morris.Bar({
      element: 'downloads',
      data: [
        <% @downloads.list.take(12).reverse.each do |result| %>
          { date: "<%= result[0] %>", metric: <%= result[1] %>},
        <% end %>
      ],  
      xkey: 'date',
      ykeys: ['metric'],
      labels: ["<%= t('.downloads') %>"],
      gridTextSize: '12px',
      gridLineColor: '#E5E5E5',
      gridIntegers: true,
      ymin: 0,
      resize: true
    });
</script>