Sha256: a195a4e42cf16201c69f01ecf8985170c850520f7680af232784e19fc24f943e
Contents?: true
Size: 652 Bytes
Versions: 26
Compression:
Stored size: 652 Bytes
Contents
# Handles requests for sparkline graphs. # # You shouldn't need to edit or extend this, but you can read # the documentation for SparklinesHelper to see how to call it from # another view. # # AUTHOR # # Geoffrey Grosenbach[mailto:boss@topfunky.com] # # http://topfunky.com # class SparklinesController < ApplicationController layout nil def index # Make array from comma-delimited list of data values ary = [] params['results'].split(',').each do |s| ary << s.to_i end send_data( Sparklines.plot( ary, params ), :disposition => 'inline', :type => 'image/png', :filename => "spark_#{params[:type]}.png" ) end end
Version data entries
26 entries across 26 versions & 2 rubygems