网上搜了出来都是php上传,有哪位同学知道怎么不用php嘛?我只要在自己的电脑上能显示就行了。
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ECharts</title> <!-- 引入 echarts.js --> <script src="D:\echarts3\echarts.js"></script> <script src="D:\echarts3\roma.js"></script> <script src="D:\echarts3\jquery-3.1.1.min.js"></script> </head> <body> <!-- 为ECharts准备一个具备大小(宽高)的Dom --> <div id="main" style="width: 1200px;height:600px;"></div> <script type="text/javascript"> // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('main')); myChart.showLoading(); $.get('SJ.json', function (data) { myChart.hideLoading(); myChart.setOption(option = { title: { text: 'Sankey Diagram' }, tooltip: { trigger: 'item', triggerOn: 'mousemove' }, series: [ { type: 'sankey', layout:'none', data: data.nodes, links: data.links, itemStyle: { normal: { borderWidth: 1, borderColor: '#aaa' } }, lineStyle: { normal: { curveness: 0.5 } } } ] }); }); myChart.setOption(option); </script> </body> </html>
慕瓜9220888
慕瓜9220888