手动写的第一个eChart代码
手动写的第一个eChart代码 ,第一感觉,杂乱无章
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <!doctype html> <html> <head> <meta charset= "UTF-8" > <title>ECharts</title> </head> <body> <div id= "main" class = "" style= "height:400px" ></div> <script src= "http://echarts.baidu.com/build/dist/echarts.js" ></script> <script type= "text/javascript" > <!-- //路径配置 require.config({ paths:{ echarts: 'http://echarts.baidu.com/build/dist' } }); require( [ 'echarts' , 'echarts/chart/bar' //是用柱状图就加载bar模块,按需加载 ], function (ec){ //基于准备好的dom,初始化echarts图标 var myChart = ec.init(document.getElementById( 'main' )); var option={ tooltip:{ show: true }, legend:{ data:[ '销量' ] }, xAxis:[ { type: 'category' , data:[ "衬衫" , "羊毛衫" , "雪纺纱" , "裤子" , "高跟鞋" , "袜子" ] } ], yAxis:[ { type: 'value' } ], series:[ { "name" : "销量" , "type" : "bar" , "data" :[5,20,40,10,10,20] } ] }; myChart.setOption(option); } ); //--> </script> </body> </html> |
都是啥玩意,一会是数组 一会是json 一会是函数,七拼八凑,图标结果还显示出来了,感觉是莫名其妙
微软BI技术交流群:316744959
武汉NET技术群:961108969
NET技术群:21386099
本人具有丰富的系统开发经验,承接系统开发,小程序,NET系统开发,BI开发,有需求联系微信手机:15010195887
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步