jQuery插件echarts去掉垂直網(wǎng)格線用法示例
本文實例講述了jQuery插件echarts去掉垂直網(wǎng)格線用法。分享給大家供大家參考,具體如下:
1、問題背景
設(shè)計一條統(tǒng)計人數(shù)的折線,其中網(wǎng)格線沒有垂直線
2、實現(xiàn)源碼
(1)有垂直網(wǎng)格線
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>echarts-有垂直網(wǎng)格線</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:['人數(shù)'] }, 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:'人數(shù)', type:'line', stack: '人數(shù)', data:[1220, 4132, 6101, 3134, 1890, 6230, 3210] } ] }; echart.setOption(option); }); </script> </head> <body> <div id="chart"></div> </body> </html>
(2)無垂直網(wǎng)格線
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>echarts-去掉垂直網(wǎng)格線</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:['人數(shù)'] }, 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:'人數(shù)', type:'line', stack: '人數(shù)', data:[1220, 4132, 6101, 3134, 1890, 6230, 3210] } ] }; echart.setOption(option); }); </script> </head> <body> <div id="chart"></div> </body> </html>
3、實現(xiàn)結(jié)果
(1)有垂直網(wǎng)格線
(2)無垂直網(wǎng)格線
4、問題說明
去掉網(wǎng)格中的垂直線,只需在xAxis中加入splitLine
屬性的設(shè)置show:false
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery常用插件及用法總結(jié)》、《jquery中Ajax用法總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jQuery擴展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》及《jquery選擇器用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計有所幫助。
- jQuery插件echarts設(shè)置折線圖中折線線條顏色和折線點顏色的方法
- 如何使用PHP+jQuery+MySQL實現(xiàn)異步加載ECharts地圖數(shù)據(jù)(附源碼下載)
- jQuery插件Echarts實現(xiàn)的漸變色柱狀圖
- jQuery插件echarts實現(xiàn)的多柱子柱狀圖效果示例【附demo源碼下載】
- jQuery插件echarts實現(xiàn)的多折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實現(xiàn)的單折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實現(xiàn)的去掉X軸、Y軸和網(wǎng)格線效果示例【附demo源碼下載】
- jQuery插件echarts實現(xiàn)的循環(huán)生成圖效果示例【附demo源碼下載】
- HTML5+JS+JQuery+ECharts實現(xiàn)異步加載問題
- jQuery插件Echarts實現(xiàn)的雙軸圖效果示例【附demo源碼下載】
- jquery使用echarts實現(xiàn)有向圖可視化功能示例
相關(guān)文章
Mui使用jquery并且使用點擊跳轉(zhuǎn)新窗口的實例
下面小編就為大家?guī)硪黄狹ui使用jquery并且使用點擊跳轉(zhuǎn)新窗口的實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-08-08jquery 的 $("#id").html() 無內(nèi)容的解決方法
今天在做一個輸入用到j(luò)query的.html方法,可是用.html()輸不出來2010-06-06jquery在啟動頁面時,自動加載數(shù)據(jù)的實例
下面小編就為大家分享一篇jquery在啟動頁面時,自動加載數(shù)據(jù)的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01Jquery EasyUI實現(xiàn)treegrid上顯示checkbox并取選定值的方法
這篇文章主要介紹了Jquery EasyUI實現(xiàn)treegrid上顯示checkbox并取選定值的方法的相關(guān)資料,需要的朋友可以參考下2016-04-04關(guān)于hashchangebroker和statehashable的補充文檔
我覺得之前寫的兩篇隨筆有點不負責任,完全沒寫明白,補充了一份文檔(權(quán)且算是文檔吧=.=)2011-08-08