Echart 关系图使用
2017-04-24 18:43
148 查看
下载资源文件
dataTool.min.jsles-miserables.gexf
其他自行找
Coding
<!DOCTYPE html> <html> <head> <meta charset='utf-8'> <title>ECharts</title> <!-- 引入 echarts.js --> <script src='echarts.js'></script> <script src='dataTool.min.js'></script> <script src='../jquery-1.12.4.min.js'></script> </head> <body> <div id='main' style='width: 600px;height:400px;'></div> <script type='text/javascript'> var myChart = echarts.init(document.getElementById('main')); myChart.showLoading(); $.get('les-miserables.gexf', function (xml) { myChart.hideLoading(); var graph = echarts.dataTool.gexf.parse(xml); var categories = []; for (var i = 0; i < 9; i++) { categories[i] = { name: '类目' + i }; } graph.nodes.forEach(function (node) { node.itemStyle = null; node.value = node.symbolSize; node.symbolSize /= 1.5; node.label = { normal: { show: node.symbolSize > 30 } }; node.category = node.attributes.modularity_class; }); option = { title: { text: 'Les Miserables', subtext: 'Default layout', top: 'bottom', left: 'right' }, tooltip: {}, legend: [{ // selectedMode: 'single', data: categories.map(function (a) { return a.name; }) }], animationDurationUpdate: 1500, animationEasingUpdate: 'quinticInOut', series : [ { name: 'Les Miserables', type: 'graph', layout: 'none', circular: { rotateLabel: true }, data: graph.nodes, links: graph.links, categories: categories, roam: true, label: { normal: { position: 'right', formatter: '{b}' } }, lineStyle: { normal: { color: 'source', curveness: 0.3 } } } ] }; myChart.setOption(option); }, 'xml'); </script> </body> </html>
相关文章推荐
- 使用Perl查找VC工程依赖关系
- 使用Hibernate进行对象的关系映射
- 1.3 实体继承关系配置及使用EntityGen和Configurator[发布时间:9/8]
- Infragistics NetAdvantage控件的使用:该关系不是此 DataView 指向的表的父关系
- [网络问题,截图以后再传]本实验是设计性实验。目的在于使用关系数据库标准语言SQL,掌握视图和索引的操作。
- DataGrid的使用:(二)、利用ASP.NET DataGrid显示主次关系的数据
- 1.3 实体继承关系配置及使用EntityGen和Configurator[发布时间:9/8]
- 访问和更改关系数据,使用MSSQL外联接
- 使用webwork处理表单字段中的继承关系
- UML Rose的使用(五) --关系
- 使用对象-关系映射(ORM)系统中间件提升软件开发效率及质量
- 使用对象-关系映射(ORM)系统中间件提升软件开发效率及质量
- 使用dumpbin检查.lib的依赖关系
- 和依赖的斗争——谈谈使用模式前后的依赖关系变化
- DataGrid的使用:(二)、利用ASP.NET DataGrid显示主次关系的数据
- 在datagrid中使用表间关系(连接ACCESS)
- 使用对象-关系映射(ORM)系统中间件提升软件开发效率及质量
- hibernate3 关系映射 使用说明
- SQL中使用关系代数合并数据
- 使用Hibernate进行对象的关系映射(1)