New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82158


Ignore:
Timestamp:
08/08/11 20:27:24 (4 years ago)
Author:
derek@…
Message:

Display charts along with port information

Charts are:

  • Installations over the past 12 months
  • Version installations over the past 12 months
  • Current distribution of versions installed
  • Current distribution of variants installed

Fine details:

  • Set chart title and type for each chart
  • Order the charts
  • Draw charts using gvis
  • Display a table of all data collected for this port for verification (debugging)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb

    r80511 r82158  
     1<% controller.set_chart_title :version_count, 'All Versions' %> 
     2<% controller.set_chart_type :version_count, 'PieChart' %> 
     3 
     4<% controller.set_chart_title :variant_count, 'All Variants' %> 
     5<% controller.set_chart_type :variant_count, 'PieChart' %> 
     6 
     7<% controller.set_chart_title :versions_over_time, 'Top Versions in use Over Last 12 Months' %> 
     8<% controller.set_chart_type :versions_over_time, 'LineChart' %> 
     9 
     10<% controller.set_chart_title :installs_over_time, 'Installations Over Last 12 Months' %> 
     11<% controller.set_chart_type :installs_over_time, 'LineChart' %> 
     12 
     13<%# Order the charts %> 
     14<% ordered_charts = [:installs_over_time,  
     15                     :versions_over_time,  
     16                     :version_count,  
     17                     :variant_count] %> 
     18 
    119<div id="content"> 
    220  <p> 
     
    3149  <% end %> 
    3250 
     51  <%# Draw charts %> 
     52  <% ordered_charts.each do |chart| %> 
     53    <% options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %> 
     54    <% options[:title] = controller.chart_title chart %> 
     55    <% type = controller.chart_type chart %> 
     56 
     57    <% visualization chart, type, options do |visualization| %> 
     58      <% controller.populate_chart chart, visualization %> 
     59    <% end %> 
     60  <% end %> 
     61 
     62  <% @installed.each do |row| %> 
     63    <tr> 
     64      <td> <%= row.id %> </td> 
     65      <td> <%= row.port_id %> </td> 
     66      <td> <%= row.version %></td> 
     67      <td> <%= row.variants %> </td> 
     68      <td> <%= row.updated_at %> </td> 
     69    </tr> 
     70  <% end %> 
     71 
    3372</div> 
Note: See TracChangeset for help on using the changeset viewer.