I want lineChart of Chart.js in my sinatra application. But firefox console says
`TypeError:this.scale is undefined(Chart.js:2686)`
and, lineChart is not displayed.I wrote following code.
@hello.erb
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="Chartjs/Chart.js" type="text/javascript"></script>
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<canvas id="line" height="450" width="600"></canvas>
</body>
</html>
@script.js
$(function(){
var lineChartData = {
labels : ["hoge","fuga"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [60,70]
} ]
}
var myLine = new Chart(document.getElementById("line").getContext("2d")).Line(lineChartData);
});
When I write this code in NOT sinatra(erb), it works correctly. What should I do modify?