jQuery插件echarts去掉垂直網格線用法示例
本文實例講述了jQuery插件echarts去掉垂直網格線用法。分享給大家供大家參考,具體如下:
1、問題背景
設計一條統計人數的折線,其中網格線沒有垂直線
2、實現源碼
(1)有垂直網格線
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>echarts-有垂直網格線</title> <link rel="shortcut icon" href="../js/echarts-2.2.7/doc/asset/ico/favicon.png" rel="external nofollow" rel="external nofollow" > <script type="text/javascript" src="../js/echarts-2.2.7/doc/asset/js/jquery.min.js" ></script> <script type="text/javascript" src="../js/echarts-2.2.7/doc/example/www2/js/echarts-all.js" ></script> <style> body,html{ width: 99%; height: 99%; font-family: "微軟雅黑"; font-size: 12px; } #chart{ width: 100%; height: 100%; } </style> <script> $(function(){ var chart = document.getElementById('chart'); var echart = echarts.init(chart); var option = { title: { text: '' }, tooltip: { trigger: 'axis' }, legend: { data:['人數'] }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, toolbox: { feature: { saveAsImage: {} } }, xAxis: { type: 'category', boundaryGap: false, splitLine:{ show:true }, data: ['周一','周二','周三','周四','周五','周六','周日'] }, yAxis: { type: 'value' }, series: [ { name:'人數', type:'line', stack: '人數', data:[1220, 4132, 6101, 3134, 1890, 6230, 3210] } ] }; echart.setOption(option); }); </script> </head> <body> <div id="chart"></div> </body> </html>
(2)無垂直網格線
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>echarts-去掉垂直網格線</title> <link rel="shortcut icon" href="../js/echarts-2.2.7/doc/asset/ico/favicon.png" rel="external nofollow" rel="external nofollow" > <script type="text/javascript" src="../js/echarts-2.2.7/doc/asset/js/jquery.min.js" ></script> <script type="text/javascript" src="../js/echarts-2.2.7/doc/example/www2/js/echarts-all.js" ></script> <style> body,html{ width: 99%; height: 99%; font-family: "微軟雅黑"; font-size: 12px; } #chart{ width: 100%; height: 100%; } </style> <script> $(function(){ var chart = document.getElementById('chart'); var echart = echarts.init(chart); var option = { title: { text: '' }, tooltip: { trigger: 'axis' }, legend: { data:['人數'] }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, toolbox: { feature: { saveAsImage: {} } }, xAxis: { type: 'category', boundaryGap: false, splitLine:{ show:false }, data: ['周一','周二','周三','周四','周五','周六','周日'] }, yAxis: { type: 'value' }, series: [ { name:'人數', type:'line', stack: '人數', data:[1220, 4132, 6101, 3134, 1890, 6230, 3210] } ] }; echart.setOption(option); }); </script> </head> <body> <div id="chart"></div> </body> </html>
3、實現結果
(1)有垂直網格線
(2)無垂直網格線
4、問題說明
去掉網格中的垂直線,只需在xAxis中加入splitLine
屬性的設置show:false
更多關于jQuery相關內容感興趣的讀者可查看本站專題:《jQuery常用插件及用法總結》、《jquery中Ajax用法總結》、《jQuery表格(table)操作技巧匯總》、《jQuery擴展技巧總結》、《jQuery常見經典特效匯總》及《jquery選擇器用法總結》
希望本文所述對大家jQuery程序設計有所幫助。
- jQuery插件echarts設置折線圖中折線線條顏色和折線點顏色的方法
- 如何使用PHP+jQuery+MySQL實現異步加載ECharts地圖數據(附源碼下載)
- jQuery插件Echarts實現的漸變色柱狀圖
- jQuery插件echarts實現的多柱子柱狀圖效果示例【附demo源碼下載】
- jQuery插件echarts實現的多折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實現的單折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實現的去掉X軸、Y軸和網格線效果示例【附demo源碼下載】
- jQuery插件echarts實現的循環(huán)生成圖效果示例【附demo源碼下載】
- HTML5+JS+JQuery+ECharts實現異步加載問題
- jQuery插件Echarts實現的雙軸圖效果示例【附demo源碼下載】
- jquery使用echarts實現有向圖可視化功能示例
相關文章
jquery 的 $("#id").html() 無內容的解決方法
今天在做一個輸入用到jquery的.html方法,可是用.html()輸不出來2010-06-06Jquery EasyUI實現treegrid上顯示checkbox并取選定值的方法
這篇文章主要介紹了Jquery EasyUI實現treegrid上顯示checkbox并取選定值的方法的相關資料,需要的朋友可以參考下2016-04-04關于hashchangebroker和statehashable的補充文檔
我覺得之前寫的兩篇隨筆有點不負責任,完全沒寫明白,補充了一份文檔(權且算是文檔吧=.=)2011-08-08