X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/1620856a8a47219f3a2cbb5288137b11467886fc..a16962155a3c3c6616bfe32c7216f3631836d38c:/vendor/plugins/sparklines/lib/sparklines_helper.rb diff --git a/vendor/plugins/sparklines/lib/sparklines_helper.rb b/vendor/plugins/sparklines/lib/sparklines_helper.rb new file mode 100644 index 0000000..c8958d3 --- /dev/null +++ b/vendor/plugins/sparklines/lib/sparklines_helper.rb @@ -0,0 +1,18 @@ +# Provides a tag for embedding sparklines graphs into your Rails app. +# +module SparklinesHelper + + # Call with an array of data and a hash of params for the Sparklines module. + # + # sparkline_tag [42, 37, 43, 182], :type => 'bar', :line_color => 'black' + # + # You can also pass :class => 'some_css_class' ('sparkline' by default). + def sparkline_tag(results=[], options={}) + url = { :controller => 'sparklines', + :results => results.join(',') } + options = url.merge(options) + + %(Sparkline Graph) + end + +end