Search code examples
javascriptruby-on-railsruby-on-rails-3rubygemsruby-on-rails-plugins

Seer gem generating a javascript in output


I'm using seer gem to generate line chart. It is generating a java script in output instead of chart. Can any one help me to fix this.

Currently my seer initialization code.

<%=  raw Seer::init_visualization -%>
<%= Seer::visualize(
      @sensors,
      :as => :line_chart,
      :in_element => 'chart',
      :series => {
        :series_label => "Temperature for last #{@graph_interval} Hours",
        :data_label => 'graph_time',
        :data_method => 'ph_reading',
        :data_series => @series
      },
      :chart_options => {
        :height => 300,
        :width => 1000,
        :axis_font_size => 10,
        :colors => ['#0099CC','#990000','#009900'],
        :title => "",
        :point_size => 0,
        :line_size => 2,
        :title_y => "PH Value",
        :smooth_line => "true"

      }
     )
 %>

Solution

  • I have not used the Seer gem but don't you just need to wrap both calls in raw method? you are doig this on the init call but not the visualize

    <%= raw Seer::visualize(...