<h3><%=vanity_h metric.name %></h3>
<%= vanity_simple_format vanity_h(Vanity::Metric.description(metric).to_s), :class=>"description" %>
<%=
begin 
  data = Vanity::Metric.data(metric)
  min, max = data.map(&:last).minmax
  js = data.map { |date,value| "['#{date.to_time.httpdate}',#{value}]" }.join(",")
  vanity_html_safe(%{<div class="chart"></div>
    <script type="text/javascript">
    $(function(){Vanity.metric("#{vanity_h id.to_s}").plot([{label:"#{vanity_h metric.name}", data: [#{js}]}])})
    </script>})
rescue Exception=>ex
  %{<div class="error">#{vanity_h ex.message}</div>}
end %>

<h3><%=vanity_h metric.name %></h3>
<%= vanity_simple_format(vanity_h(metric.description), :class=>"description") %>
<%= vanity_html_safe(%Q{<div class="chart"></div>
    <script type="text/javascript">
    $(function() {
      Vanity.metric("#{vanity_h(id)}")
        .plot([{
          label:"#{vanity_h(metric.name)}",
          data: [#{Vanity::Metric.data(metric).map { |date,value| "['#{date.to_time.httpdate}',#{value}]" }.join(",")}]
        }])
    })
    </script>}
  )
%>

Remove unused variables in metric partial, fix Rails4.1
Remove unused variables in metric partial, fix Rails4.1

Closes #226.
