Chart.js
Simple HTML5 Charts using the canvas element chartjs.org
请下载Chart.js, test.js, test.html到本地同一目录下,然后打开test.html即可查看效果
使用方式同Chart.js一样:
<script type="text/javascript" src="Chart.min.js"></script>
<canvas id="myChart1" width="800" height="400"></canvas>
var ctx1 = document.getElementById("myChart1").getContext("2d");
var myNewChart = new Chart(ctx1).Gantt(data);
数据结构
var data = {
start: "2014-01-20",
totalWeeks: 9,
tasks: [{
name: "Today I need go to school",
from: 0,
to: 4
},
{
name: "界面设计",
from: 4,
to: 7
},
{
name: "数值分析",
from: 3,
to: 5
},
{
name: "关卡分析",
from: 5,
to: 7
},
{
name: "测试",
from: 8,
to: 9
}
}
You can find documentation at chartjs.org/docs.
Chart.js was taken down on the 19th March. It is now back online for good and IS available under MIT license.
Chart.js is available under the [MIT license] (http://opensource.org/licenses/MIT).