//topology图 的 key 一定 至少要包含有id ,label , link var data = [ [ "id" , "label" , "link" ], [ "lol" , "英雄联盟", [ "dmhz" , "jfjh" ] ], [ 'dmhz' , "德玛皇子", [ "ms" , "gl" ] ], [ 'jfjh' , "亚索" , [ "wqds" ] ], [ 'hbss' , "艾希" , [ "mgn" , "jj" ] ], [ 'ms' , "盲僧" , [ "hbss" ] ], [ 'wqds' , "武器大师", [ "zzzw" ] ], [ 'zzzw' , "潘神" , [ ] ], [ 'js' , "剑圣" , [ ] ], [ 'jj' , "剑姬" , [ ] ], [ 'mgn' , "莫甘娜" , [ ] ], [ 'gl' , "盖伦" , [ "js" ] ] ]; var options = { type : "tree", graph : { rankdir : "LR" } } Chartx.topo("canvasTest" , data , options).then(function( tree ){ tree.on("nodeMouseover" , function(){ console.log( "nodeMouseover" ); }); tree.on("nodeMouseout" , function(){ console.log( "nodeMouseOut" ); }); tree.on("nodeClick" , function(e){ console.log( "nodeClick" ); }); })
topology图(tree)
联系人:@释剑