0
A
回答
0
@ selten98:当然,我在这里的代码:
for (var i in plot) {
groups.add({
content: labelArray[i],
id: plot[i],
options: {
shaded: {
orientation: "bottom"
}
}
});
for (var j in GD) {
if (GD[j].hasOwnProperty(plot[i])) {
items.push({
group: plot[i],
label: {
className: "visibility-hidden label-group-" + labelArray[i],
content: GD[j][plot[i]].toFixed(1),
xOffset: -10/3 * GD[j][plot[i]].toFixed(1).length,
yOffset: 20
},
x: new Date(GD[j].timestamp),
y: Number(String(GD[j][plot[i]]).replace(",", "."))
});
}
}
}
for (var i = 0; i < items.length; i++) {
if (i == 0) {
groups.add({
content: groupId,
id: groupId,
style: "stroke:" + arr_color[properties],
options: {
shaded: {
orientation: "bottom",
style: "fill:" + arr_color[properties]
},
drawPoints: {
styles: "stroke:" + arr_color[properties] + ";fill:" + arr_color[properties]
}
}
});
items[i].group = groupId;
scope.labels[properties].max = Number(items[i].y).toFixed(1);
scope.labels[properties].min = Number(items[i].y).toFixed(1);
} else {
if (items[i].label.className == items[i - 1].label.className) {
if (items[i].x.getTime() - items[i - 1].x.getTime() > Number(type[1]) * 60 * 1000) {
groupId++;
groups.add({
content: groupId,
id: groupId,
style: "stroke:" + arr_color[properties],
options: {
shaded: {
orientation: "bottom",
style: "fill:" + arr_color[properties]
},
drawPoints: {
styles: "stroke:" + arr_color[properties] + ";fill:" + arr_color[properties]
}
}
});
}
items[i].group = groupId;
scope.labels[properties].max = Math.max(scope.labels[properties].max, Number(items[i].y)).toFixed(1);
scope.labels[properties].min = Math.min(scope.labels[properties].min, Number(items[i].y)).toFixed(1);
} else {
groupId++;
properties++;
groups.add({
content: groupId,
id: groupId,
style: "stroke:" + arr_color[properties],
options: {
shaded: {
orientation: "bottom",
style: "fill:" + arr_color[properties]
},
drawPoints: {
styles: "stroke:" + arr_color[properties] + ";fill:" + arr_color[properties]
}
}
});
items[i].group = groupId;
scope.labels[properties].max = Number(items[i].y).toFixed(1);
scope.labels[properties].min = Number(items[i].y).toFixed(1);
}
}
}
var container = document.getElementById("graph");
container.innerHTML = "";
var dataset = new vis.DataSet(items);
var options = {
dataAxis: {
left: {
format: function (value) {
return Number(value).toFixed(1);
}
}
},
drawPoints: {
style: "circle"
},
orientation: "top",
showCurrentTime: true,
end: new Date(end),
max: new Date(end),
min: new Date(start),
start: new Date(start)
};
startTime = options.start.getTime();
endTime = options.end.getTime();
var graph2d = new vis.Graph2d(container, dataset, groups, options);
相关问题
- 1. 没有adobe cirrus的点对点连接
- 2. 在VS 2008 SP1中进行调试时,断点没有连接
- 3. 运输端点没有连接
- 4. getConnection在JDBC连接本地mysql时没有连接db
- 5. Signalr没有连接
- 6. QPushbutton没有连接
- 7. 有没有办法在VBA中连接?
- 8. 只有在终端没有连接
- 9. 在没有连接的套接字中写入时没有错误
- 10. 连接到服务时没有端点侦听
- 11. Zend_Db_Profiler没有记录db连接时间?
- 12. Maven安装时没有网络连接
- 13. 没有连接被称为未连接
- 14. Nodejs连接SQL没有连接
- 15. 在启动spring-boot时,tomcat datasource没有检查有效连接?
- 16. 连接到SqlServer时没有“UserActionEvent的连接池”
- 17. Rails + SQL:当没有连接时包含连接表
- 18. 休眠c3p0连接池没有超时空闲连接
- 19. 尝试连接时没有使用tnsnames连接TNS listner错误#
- 20. Facebook的连接:没有JavaScript?
- 21. 连接没有对象
- 22. PostgreSQL没有关闭连接
- 23. UICollectionView没有连接到类
- 24. 没有数据库连接
- 25. 连接表没有空
- 26. System.InvalidOperationException:连接没有关闭
- 27. Droidcam没有连接到opencv
- 28. web2py没有连接到mysql
- 29. SVG路径没有连接
您可以添加代码? – selten98