日期:2012-4-7 来源:GBin1.com

今天我们介绍一个超棒的创建快速动态互动HTML5可视化图形效果的javascript类库 - Envision.js,这个类库拥有俩个内建的图表类型:
引入如下类库和CSS文件:
一个简单的例子:
body {
margin: 0px;
padding: 0px;
}
#container {
width : 600px;
margin: 8px auto;
}
<!--[if IE]>
(function () {
var
container = document.getElementById('container'),
x = [],
y1 = [],
y2 = [],
data, options, i;
// Data Format:
data = [
[x, y1], // First Series
[x, y2] // Second Series
];
// Sample the sine function for data
for (i = 0; i < 4 * Math.PI; i += 0.05) {
x.push(i);
y1.push(Math.sin(i));
y2.push(Math.sin(i + Math.PI));
}
x.push(4 * Math.PI)
y1.push(Math.sin(4 * Math.PI));
y2.push(Math.sin(4 * Math.PI));
// TimeSeries Template Options
ptions = {
// Container to render inside of
container : container,
// Data for detail (top chart) and summary (bottom chart)
data : {
detail : data,
summary : data
}
};
// Create the TimeSeries
new envision.templates.TimeSeries(options);
})();
API文档:http://www.humblesoftware.com/envision/documentation
希望大家喜欢这个类库!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8288/viewspace-720832/ ,如需转载,请注明出处,否则将追究法律责任。