Permalink
Browse files

Added width and height for image tag such that , graphs which dont ha…

…ve :width , like smooth graph, dont overshoot required image size in HTML to disturb layouts

Signed-off-by: Geoffrey Grosenbach <boss@topfunky.com>
  • Loading branch information...
1 parent dc230e8 commit feabc5b29b9444957d7d911d511b1d2bb8254ded Abhishek Parolkar committed with Dec 9, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/sparklines_helper.rb
View
3 lib/sparklines_helper.rb
@@ -14,6 +14,9 @@ def sparkline_tag(results=[], options={})
options = url.merge(options)
attributes = %(class="#{options[:class] || 'sparkline'}" alt="Sparkline Graph" )
attributes << %(title="#{options[:title]}" ) if options[:title]
+
+ attributes << %(width="#{options[:width]}" ) if options[:width]
+ attributes << %(height="#{options[:height]}" ) if options[:height]
# prefer to use a "data" URL scheme as described in {RFC 2397}[http://www.ietf.org/rfc/rfc2397.txt]
# data_url = "data:image/png;base64,#{Base64.encode64(Sparklines.plot(results,options))}"

0 comments on commit feabc5b

Please sign in to comment.