我想使用 JSON 对象制作流程图
HTML
var chart = null;
$(document).ready(function(){
chart = new FlowChart($);
var chartJSON = {
nodes: [
{ id: 'p1', type: 'simple-node', left: 120 ,top:2200 , content:'Process 1'},
{ id: 'p2', type: 'simple-node', left: 120,top: 2400,content:'Process 2' },
{ id: 'p3', type: 'simple-node', left: 120, top: 2600,content:'Process 3'}
],
connections: [
{ start: 'p1', end: 'p2' },
{ start: 'p2', end: 'p3' },
]
};
chart.importChart(chartJSON);
这会像这样在页面上创建一个流程图
但我需要根据 sql 查询结果动态地从代码后面填充这个 json,我是 javascript 的新手,无法找到解决方案的确切方向。
最佳答案
关于javascript - 如何从 C# 中的代码隐藏动态生成 JSON 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37267692/