Sha256: a0a312c27e225e9c1f9c05b1b35fae27ee394a0aa7430139144f7aba7864ee57

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

<h3><%=h metric.name %></h3>
<%= simple_format 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(",")
  %{<div class="chart"></div>
    <script type="text/javascript">
    $(function(){Vanity.metric("#{h id}").plot([{label:"#{h metric.name}", data: [#{js}]}])})
    </script>}
rescue Exception=>ex
  %{<div class="error">#{h ex}</div>}
end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mikeg-vanity-1.3.0 lib/vanity/templates/_metric.erb