本文實(shí)例講述了jQuery插件echarts實(shí)現(xiàn)的去掉X軸、Y軸和網(wǎng)格線效果。分享給大家供大家參考,具體如下:
1、問題背景:
如何在echarts中,去掉X軸、Y軸和網(wǎng)格線,只留數(shù)據(jù)圖形
2、實(shí)現(xiàn)源碼:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>echarts-去掉X軸、Y軸和網(wǎng)格線</title> <script type="text/javascript" src="jquery-1.4.2.min.js" ></script> <script type="text/javascript" src="echarts.js" ></script> <script> $(function(){ function randomDataArray() { var d = []; var arr = [3,5,7,9,10,1,2,4,8,6]; var len = 10; for(var i=0;i<len;i++) { d.push([i+1,0,arr[i],]); } return d; } var chart = document.getElementById('chart'); var echart = echarts.init(chart); var option = { legend: { data:['scatter1'], show:false }, textStyle:{ fontSize:16 }, xAxis : [ { type : 'value', splitNumber: 2, scale: true, show:false, splitLine:{ show:false } } ], yAxis : [ { type : 'value', splitNumber: 2, scale: true, show:false, splitLine:{ show:false } } ], series : [ { name:'scatter1', type:'scatter', symbol: 'emptyCircle', symbolSize: 20, itemStyle : { normal: { label:{ show: true, position: 'inside', textStyle : { fontSize : 24, fontFamily : '微軟雅黑', color:'#FF0000' } } } }, data: randomDataArray() } ] }; echart.setOption(option); }); </script> </head> <body> <p id="chart" style="width: 1200px; height: 220px;"></p> </body> </html>
3、實(shí)現(xiàn)效果圖:
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com