Tôi đang hiển thị biểu đồ bằng cách sử dụng highstocks trên ứng dụng đường ray của tôi trên tệp index.html.erb, tuy nhiên khi tôi cố tải biểu đồ, tôi nhận được lỗi sau trên bảng điều khiển firebug,ReferenceError: HighCharts không được xác định
ReferenceError: HighCharts is not defined
new HighCharts.Chart({
tập tin index.html.erb của tôi là như sau
<div id="quotes_chart", style="width=560px; height:300px;">
<script>
$(function(){
new HighCharts.Chart({
chart : {
renderTo: "quotes_chart"
},
title : {
text: "Daily trades"
},
xAxis : {
type: "datetime"
},
yAxis : {
title: {
text: "Shillings"
}
},
tooltip : {
formatter: function(){
return HighCharts.dateFormat("%B %e, %Y", this.x) + ': ' + "Kshs" + Highcharts.numberFormat(this.y, 2);
}
},
series: [
<% { "Telecommunication" => StockQuote.telecomm, "Agriculture" => StockQuote.agric }.each do |name, prices|
%>
{
name: <%= name %>,
pointInterval: <%= 1.day * 1000 %>,
pointStart: <%= 2.weeks.ago.to_i * 1000 %>,
data: <%= (2.weeks.ago.to_date..Date.today).map { |date| StockQuote.price_on(date).to_f}.inspect%>
},
<% end %>
]
});
});
</script>
</div>
Trong application.html.erb của tôi là như sau:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="components/highstock/highstock.js"></script>
<%= javascript_include_tag "jquery-1.11.0.min", "highcharts" %>
Trong thư mục thử nghiệm ứng dụng/javascripts của tôi, tôi có cả tệp jquery-1.11.0.min.js và highcharts.js được tải xuống từ highcharts.com
Tôi có thể làm gì sai?