基于d3.js 封装一些项目中的图表
- npm i -S mycharts
- import myCharts from "mycharts"
- require('mycharts/dist/myCharts.css');
var node_list = [ {id:0,fid:0,word:'测试0',post:'test1',dep_type:'TEST1',color:'#333',bgColor:'red'}, {id:1,fid:0,word:'测试1',post:'test2',dep_type:'TEST2'} ]; var d1 = new myCharts('#d1'); d1.setOptions({ type:'dependencyGrammar', data: node_list }) .on('click',function(data){ console.log(data) })