Sha256: fe194ebacf0272d47894395349b4310c0d785a78b332c7d65f4fe0c32b60b4c5

Contents?: true

Size: 598 Bytes

Versions: 29

Compression:

Stored size: 598 Bytes

Contents

<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 %>

Version data entries

29 entries across 29 versions & 5 rubygems

Version Path
vanity-1.9.3 lib/vanity/templates/_metric.erb
vanity-1.9.2 lib/vanity/templates/_metric.erb
vanity-1.8.4 lib/vanity/templates/_metric.erb
vanity-2.0.0.beta2 lib/vanity/templates/_metric.erb
vanity-2.0.0.beta lib/vanity/templates/_metric.erb
vanity-1.9.1 lib/vanity/templates/_metric.erb
vanity-1.9.0 lib/vanity/templates/_metric.erb
vanity-1.9.0.beta lib/vanity/templates/_metric.erb
vanity-1.8.3 lib/vanity/templates/_metric.erb
vanity-1.8.3.beta2 lib/vanity/templates/_metric.erb
vanity-1.8.3.beta lib/vanity/templates/_metric.erb
vanity-1.8.2 lib/vanity/templates/_metric.erb
vanity-1.8.1 lib/vanity/templates/_metric.erb
lookout-vanity-1.8.2 lib/vanity/templates/_metric.erb
moses-vanity-1.8.1 lib/vanity/templates/_metric.erb
moses-vanity-1.8.0 lib/vanity/templates/_metric.erb
vanity-1.8.0 lib/vanity/templates/_metric.erb
moses-vanity-1.7.1 lib/vanity/templates/_metric.erb
fiverr-vanity-1.7.2 lib/vanity/templates/_metric.erb
vanity-1.7.1 lib/vanity/templates/_metric.erb