我正在使用lazy_high_charts
和foundation 4
。
在我看来,我有<%= high_chart("my_id", @chart) %>
,它会生成以下内容:
<section>
<script type="text/javascript">
(function() {
var onload = window.onload; # I think
window.onload = function(){ # the issue
if (typeof onload == "function") onload(); # is here
var options = { "title": { "text": "Combination chart" },"legend": { "layout": "vertical","style": { } },"xAxis": { },"yAxis": { "title": { "text": null },"labels": { } },"tooltip": { "enabled": true },"credits": { "enabled": false },"plotOptions": { "areaspline": { } },"chart": { "defaultSeriesType": "line","renderTo": "my_id" },"subtitle": { },"series": [{ "type": "spline","name": "Average","data": [ 3,2.67,3,6.33,3.33 ] }] };
window.chart_my_id = new Highcharts.Chart(options);
};
})()
</script>
<div id="my_id"></div>
</section>
但是,由于foundation 4
在我的application.js
$(document).foundation();
$(function(){ $(document).foundation(); });
如果我删除这些线,图表就会加载。
我怎样才能使用foundation
和lazy_high_charts
在一起?