title: new Highcharts.Chart creating trouble. Why?
body: <p>I have the following code:</p>
  
  <p><strong>assets/javascript/activities.js.coffee</strong></p>
  
  <pre><code>jQuery -&gt;
      graph = new Highcharts.Chart
          chart: 
              renderTo: "activity_graph"
              type: 'column'
  
          exporting:
              buttons:
                  printButton:
                      enabled: true   
  ....
  </code></pre>
  
  <p><strong>assets/javascript/activity_groups.js.coffee</strong></p>
  
  <pre><code>jQuery -&gt; 
      $('ul').children('ul').hide()
  </code></pre>
  
  <p>The activity_group file does not work if I have new Highcharts.Chart in my activities file. If I comment new Highcharts.Chart it works fine. Both files load properly. Why does this happen?</p>
  
  <p><strong>[Edit1]</strong></p>
  
  <p>I was playing around I also noticed that If I place <code>$('ul').children('ul').hide()</code> before <code>graph = new Highcharts.Chart</code> it also works as expected. I don't want to place it in the same file though and I don't want to have to place it in front of the graph variable necessarily. </p>
  
  <p><strong>[Edit2]</strong> </p>
  
  <p>Found one error why I assume it is not working. I am not very knowledgable with javascript.
  Uncaught Highcharts error #13:</p>
  
  <p>Highcharts Error #13</p>
  
  <p>Rendering div not found</p>
  
  <p>This error occurs if the chart.renderTo option is misconfugured so that Highcharts is unable to find the HTML element to render the chart in.</p>
  
  <p>My markup only contains the activity_graph div where I need it( In my activities show view). It is not included anywhere else. That is why I assume I am getting this error. I don't want to use it anywhere else though... Any thoughts? </p>
  
  <p><strong>[Edit3]</strong></p>
  
  <p>This is the markup that I am generating with rails:</p>
  
  <pre><code>= content_tag :div, "", id: "activity_graph", data: {name: graph.name, minutes: graph.minutes, year: graph.year, month: graph.month, day: graph.day, data_hash: graph.data_hash}
  </code></pre>
  
  <p>I get my div with id activity_graph and the graph is displayed without problems. The error doesn't pop up when I am on this page... However If I navigate on a different page then the error pops up because I don't have this div and the id anymore... </p>