我正在使用“JavaScript Infovis”工具包,“SpaceTree控件”适合需要 数据可视化。
我正在使用“jQuery”调用“Ajax”来动态地将数据加载到树中。 这棵树装得很好。但是,当我单击任何节点时,我收到以下错误消息:
Canvas未定义
我从我的aspx页面调用这个Javascript库:
$j(document).ready(function() {
var aURL = 'CompanyHierarchyList.ashx?CompanyID=<%=CompanyID %>';
$j.ajax({
url: aURL,
cache: false,
dataType: 'json',
success: function(json) {
LoadTree(json);
}
});
});
var st = new $jit.ST({
//id of viz container element
injectInto: 'infovis',
//set duration for the animation
duration: 200,
//set animation transition type
transition: $jit.Trans.Quart.easeInOut,
//set distance between node and its children
levelDistance: 50,
//set Orientation
orientation: 'top',
//.....
//set the other properties of node
//.......
st.loadJSON(json);
//compute node positions and layout
st.compute();
//optional: make a translation of the tree
st.geom.translate(new $jit.Complex(-200, 0), "current");
//emulate a click on the root node.
st.onClick(st.root);
//end
}
任何线索..
谢谢, KARTHIK