ビューにグラフを含めようとしていますが、うまくいきません。誰か助けてくれませんか?
それが私がビューに持っているものです(flotr2.min.jsはpublic/javascriptsにあります):
...
<div id="container">
<!--[if lt IE 9]>
<script type="text/javascript" src="/static/lib/FlashCanvas/bin/flashcanvas.js"> </script>
<![endif]-->
<%= javascript_include_tag "flotr2.min.js" %>
<script type="text/javascript">
(function () {
var d1 = [
[1, 10], [2, 8], [3, 5],[4, 13]],
d2 = [[1,12],[2,12],[3,12],[4,12],[5, 12]]
graph = Flotr.draw(container, [{data: d1, label: "Test"}, {data: d2, lines:{show: true}, points: {show: true}}], {
mode: 'time',
xaxis: {
ticks: [[1, "Jan"],[2, "Feb"], [3, "Mrz"], [4, "Apr"], [5, "Mai"], [6, "Jun"],
[7, "Jul"],[8, "Aug"], [9, "Sep"], [10, "Okt"], [11, "Nov"], [12, "Dez"]]
},
grid: {
minorVerticalLines: true,
backgroundColor: 'white'
}
});
})();
</script>
</div>