<%=h @metric.title %> Metric

<% if @metric.metric_variants.count == 0 %> No metric variants <% else %>
Conversions
<%= mg_chart("analysis_graph#{@metric.id}", { "Served" => { :collection => @rates[:served], :x => :variant_type, :y => :value }, "Conversions" => { :collection => @rates[:conversions], :x => :variant_type, :y => :value } }, { :xaxis => { :ticks => @rates[:titles].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :show => false, :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "view(s)") %>
Conversion Rates
<%= mg_chart("analysis_conv_graph#{@metric.id}", { "Conversion Rate (%)" => { :collection => @rates[:conversion_rates], :x => :variant_type, :y => :value } }, { :xaxis => { :ticks => @rates[:titles].map { |i,t| [i + 0.5, t] }.sort }, :yaxis => { :min => 0, :minTickSize => 1 }, :bars => { :show => true }, :legend => { :show => false, :position => "ne" }, :grid => { :hoverable => true, :clickable => true }, :inline => false }, :placeholder_size => "420x260", :pie_hover => true, :line_hover_absolute => true, :item_title => "%") %>
<%= @metric.title %> <% if @metric.metric_variants.count == 0 %> No metric variants [Add one] <% else %> <% @metric.metric_variants.each do |mv| %>
<%=h mv.name %> <%= number_to_percentage(mv.conversion_rate, :precision => 0) %> (<%= mv.conversions %> / <%= mv.served %>)
<% end %> <% end %>
<% end %>