Infovis JIT 库
我正在使用“JavaScript Infovis”工具包,“SpaceTree控件”适合需要 的数据可视化。
我使用“jQuery”调用“Ajax”将数据动态加载到树中。 该树加载良好。但是,当我单击任何节点时,我收到以下错误消息:
画布未定义
我从我的 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
}
任何线索..
谢谢, 卡蒂克
I am using the "JavaScript Infovis" toolkit, the "SpaceTree control" suits the needs
of data visualisation.
I am using "jQuery" to Call "Ajax" to load the data into the tree dynamically.
The tree is loading well. However, when I click on any of the nodes I get the following error message:
Canvas is Undefined
I am calling this Javascript library from my aspx page:
$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
}
any clues..
Thanks,
Karthik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://github.com/philogb/jit/issues/34 中报告了这一点。
他们还提供了一个似乎有效的答案。
This is reported in https://github.com/philogb/jit/issues/34.
They has also provided an answer which seems to work.