CoralineAda / seer

Seer is a lightweight, semantically rich wrapper for the Google Visualization API. It allows you to easily create a visualization of data in a variety of formats, including area charts, bar charts, column charts, gauges, line charts, and pie charts.
http://www.idolhands.com/ruby-on-rails/gems-plugins-and-engines/graphing-for-ruby-on-rails-with-seer
MIT License
133 stars 15 forks source link

:data_label does not accept methods declared in model #9

Open shaunakv1 opened 13 years ago

shaunakv1 commented 13 years ago

Hi Below is the code i am using. The issue I have is ,the :data_label, accepts only methods which are fields in the database. I have another method in the model of @series called suppose "abc" so data_label => 'abc' will result in an javascript error and graph wont be rendered. For that matter even data_label => 'class' wont work! The error i get in the java script is

Uncaught Error: Invalid row index 1. Should be in the range [0-0].

--Code I am using -----------------

<%= Seer::visualize( @sensors, :as => :line_chart, :in_element => 'chart', :series => { :series_label => 'location', :data_label => 'time_stamp', :data_method => 'value', :data_series => @series }, :chart_options => { :height => 250, :width => 500, :axis_font_size => 12, :colors => ['#0099CC','#990000','#009900'], :title => "Rain Data", :point_size => 0, :line_size => 3, :title_y => "Water Level in Feet", :smooth_line => "true", } ) -%>