Having Trouble Just Getting The Highchart To Show
I'm pretty new to Javascript, Rails and JQuery all working together. I'm going through this tutorial (http://www.highcharts.com/documentation/how-to-use#installation) on Highcharts
Solution 1:
As we discussed in chat, there were a few missing pieces.
- You needed a local copy of the Highcharts library
- You needed to reference your script that calls the library from the correct place.
So, in short, you needed this in your layout:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="/javascripts/js/highcharts.js" type="text/javascript"></script> <!--where you put the high charts library -->
<script src="/highcharts.js" type="text/javascript"></script> <!-- your script -->
Now going forward (assuming you are working w/ rails 3.1+), I'd suggest moving your javascripts to a more conventional location. In 3.1, rails likes to see it in app/assets/javascripts
but public/javascripts
is still fine, just not exactly conventional.
You will get a lot of milage by understanding the rails helpers to insert script tags and the Asset Pipeline.
Good luck!
Solution 2:
The problem is in the first line of source that is var charts;
remove it and you are done.
Solution 3:
There is an issue with the Chart keyword. Please change like
new Highcharts.Chart({ Chart is with small c
Post a Comment for "Having Trouble Just Getting The Highchart To Show"