话不多说,直接干货走起。对你有用的话,请赞
实现效果如下图:
实现代码:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>GoJS demo</title> <script src="../release/go.js"></script> </head> <body> <div id="myDiagramDiv6" class="diagramStyling" style="width:1000px; height:560px;margin: 30px auto;border: 1px solid #ddd"></div> <script> var dataArr = [ { key: "1", name: "xxxx股份有限公司"}, { key: "2", parent: "1", name: "xxxx增进股份有限公司",stock:'3.73%',Amount:'923,000,000'}, { key: "3", parent: "1", name: "xxxx药业集团股份有限公司",stock:'1.45%',Amount:'123,100,000',hasChildNodes:true}, { key: "4", parent: "1", name: "xxx高速公路发展股份有限公司",stock:'0.96%',Amount:'3,100,100,000'}, { key: "5", parent: "1", name: "xxxx股份有限公司",stock:'3.73%',Amount:'3,100,000,000'}, { key: "6", parent: "1", name: "xxxx药业集团股份有限公司",stock:'1.45%',Amount:'2,100,000,000'}, { key: "7", parent: "1", name: "xxxxxxx发展股份有限公司",stock:'0.96%',Amount:'1,123,000,000'}, { key: "8", parent: "1", name: "xxxx农业股份有限公司",stock:'4.88%',Amount:'1,123,000,000'}, { key: "9", parent: "2", name: "xxxxxx农业股份有限公司",stock:'2.88%