我有一个Eclipse RCP应用程序,它使用SWT浏览器通过D3.js可视化数据。另外,我现在想使用Cubism.js绘制一些实时数据。在RCP应用程序中,要绘制的值以不规则的间隔到达。
我目前尝试将数据从RCP应用程序提供给立方图的尝试很失败,如下所示(很抱歉我的JavaScript不好):
function getGraphData(name) {
var value = 0,
values = [],
i = 0,
last;
return context.metric(function(start, stop, step, callback) {
start = +start, stop = +stop;
values = [];
if (isNaN(last)) last = start;
last += step;
// extVals is a global variable that is set by the RCP application
for(var j = 0; j < extVals.length; j++){
values.push(extVals[j]);
}
// Clear the array
extVals.length = 0;
callback(null, values)
}, name);}
目前的情况是,我可以使用全局extVals数组从RCP应用程序中设置新数据,但是只有当其中一个值大于图形中的前一个值时,图形才会显示这些新值。
这方面的任何帮助都是非常感谢的。
发布于 2013-06-10 14:26:45
在创建一个显示股票图表数据的应用程序时,我遇到了数据到达时间间隔不规则的问题。
我已经在我的立体主义教程中描述了如何填充这些数据:http://xaranke.github.io/articles/cubism-intro/
https://stackoverflow.com/questions/16599236
复制相似问题