我遵循了这个网站的教程:http:
//kushagragour.in/blog/2013/06/getting-started-with-chartjs/
这是我目前的jsfiddle:
<div style="width: 500px; height: 500px;">
<canvas id="canvas"></canvas>
</div>
var lineChartData = {
labels : ["January","February","March","April","May","June","July"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : myData.mapProperty('rank')
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
pointColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff",
data : [28,48,40,19,96,27,100]
}
]
};
var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData);
json在jsfiddle中..