Module: Bumpspark::Helper

Defined in:
lib/bumpspark/helper.rb

Instance Method Summary collapse

Instance Method Details

#bumpspark_tag(numbers, html_opts = {}) ⇒ String

Generate a bumpspark-style sparkline image tag

Returns:

  • (String)


11
12
13
14
# File 'lib/bumpspark/helper.rb', line 11

def bumpspark_tag(numbers, html_opts={})
  graph = Bumpspark::Graph.new(numbers)
  tag(:img, html_opts.merge(src: graph.to_data_uri))
end