Hey all,

I get the following error. Now I know it's related to a curly brace, but
it seems that all curly braces are properly in place. So I'm not sure
why I get this error:

 SyntaxError in DashboardController#panels

rails/app/controllers/dashboard_controller.rb:170: syntax error,
unexpected '\n', expecting tASSOC


def panels

      addDetailToContainer = "function() {
          var detailContainer = jQuery('#container').prepend(
              '<div id=\"details-chart\"></div>'
            ),
            detailStart = Date.UTC(2008, 7, 1),
            detailData = [];
            jQuery.each(this.series[0].data, function(i, point) {
              if (point.x > detailStart) {
                detailData.push(point.y);
              }
            });
            "

        pie_label_formatter = "
          function() {
            if (this.y > 15) return this.point.name;
          }"

        master_detail_tooltip_formatter = "
          function() {
            return '<b>'+ (this.point.name || this.series.name)
+'</b><br/>'+
              Highcharts.dateFormat('%A %B %e %Y', this.x) + ':<br/>'+
              '1 USD = '+ Highcharts.numberFormat(this.y, 2) +' EUR';
          }"

           @pie_chart =
            Highchart.line({
              :chart => {
                :renderTo => 'container',
                :zoomType => 'x',
                :margin => [330, 30, 30, 80],
                :events => {
                  :load => addDetailToContainer,
            Highchart.line({
              :chart => {
                :borderWidth => 0,
                :backgroundColor => '#000000',
                :renderTo => "details-chart",
                :height => 330,
                :margin => [80, 30, 20, 80],
                :style => {
                  :position => 'absolute'
                }
                  },
                  :credits => {
                    :enabled => false,
                    :href => '',
                    :text => 'Data provided by Verdacom'
                  },
                  :xAxis => {
                    :type => 'datetime'
                  },
                  :yAxis => {
                    :title => '',
                    :maxZoom => 0.1
                  },
                  :legend => {
                    :enabled => false
                  },
                  :plotOptions => {
                    :series => {
                      :marker => {
                        :enabled => false,
                        :states => {
                          :hover => {
                            :enabled => true,
                            :radius => 3
                          }
                        }
                      }
                    }
                  },
                :series => [
                      {
                        :name => 'USD to EUR',
                        :pointStart => detailStart,
                        :pointInterval => 24 * 3600 * 1000,
                        :data => detailData
                      }
                  ],
                  :subtitle => {
                    :text => 'Fiscal Year 2010'
                  },
                  :title => {
                    :text => 'Cumulative Subject State By Month'
                  },
                  :tooltip => {
                    :formatter => master_detail_tooltip_formatter
                  }
              })



    ]]

  end

Thanks for any response.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to