Closed nitinsinghit closed 12 years ago
Sorry I didn't respond earlier - the issue here is that the :hAxis
option should be specified as a ruby hash, not a string containing the javascript hash/object. Like this:
:hAxis => {"title" => 'Year1', "titleColor" => 'red'}
<%= visualization "chart_id", "barChart", :hAxis => "{title: 'Year1', titleColor:'red'}",:width => 830, :height => 600, :axisColor => 'Orange' ,:colors => ['#FBC302','#9ABE94','red'], :borderColor => '#495F44' , :backgroundColor => '#f5f5f5', :legendBackgroundColor => '#f5f5f5',:legendFontSize => 16, :legend => 'top', :tooltipWidth => 250, :tooltipFontSize => 14, :titleY => 'Game', :titleX => '# of Days to Complete', :titleFontSize => 10, :isStacked => true, :min => 0, :html => {:class => "graph_class"} do |chart| %>
Above code use to work before I install gvis gem and upgrade to rails 3. Using firebug i see that there syntax error on :hAxis => "{title: 'Year1', titleColor:'red'}" . I remove hAxis but no chart rendered.
Please tell me what I am missing in the above code.