jQuery插件echarts去掉垂直網(wǎng)格線用法示例
本文實(shí)例講述了jQuery插件echarts去掉垂直網(wǎng)格線用法。分享給大家供大家參考,具體如下:
1、問題背景
設(shè)計(jì)一條統(tǒng)計(jì)人數(shù)的折線,其中網(wǎng)格線沒有垂直線
2、實(shí)現(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、實(shí)現(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擴(kuò)展技巧總結(jié)》、《jQuery常見經(jīng)典特效匯總》及《jquery選擇器用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery插件echarts設(shè)置折線圖中折線線條顏色和折線點(diǎn)顏色的方法
- 如何使用PHP+jQuery+MySQL實(shí)現(xiàn)異步加載ECharts地圖數(shù)據(jù)(附源碼下載)
- jQuery插件Echarts實(shí)現(xiàn)的漸變色柱狀圖
- jQuery插件echarts實(shí)現(xiàn)的多柱子柱狀圖效果示例【附demo源碼下載】
- jQuery插件echarts實(shí)現(xiàn)的多折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實(shí)現(xiàn)的單折線圖效果示例【附demo源碼下載】
- jQuery插件echarts實(shí)現(xiàn)的去掉X軸、Y軸和網(wǎng)格線效果示例【附demo源碼下載】
- jQuery插件echarts實(shí)現(xiàn)的循環(huán)生成圖效果示例【附demo源碼下載】
- HTML5+JS+JQuery+ECharts實(shí)現(xiàn)異步加載問題
- jQuery插件Echarts實(shí)現(xiàn)的雙軸圖效果示例【附demo源碼下載】
- jquery使用echarts實(shí)現(xiàn)有向圖可視化功能示例
相關(guān)文章
Mui使用jquery并且使用點(diǎn)擊跳轉(zhuǎn)新窗口的實(shí)例
下面小編就為大家?guī)硪黄狹ui使用jquery并且使用點(diǎn)擊跳轉(zhuǎn)新窗口的實(shí)例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-08-08
jQuery實(shí)現(xiàn)的移動端圖片縮放功能組件示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的移動端圖片縮放功能組件,結(jié)合實(shí)例形式詳細(xì)分析了jQuery基于移動端的圖片縮放功能組件實(shí)現(xiàn)原理、步驟、核心代碼及使用技巧,需要的朋友可以參考下2020-05-05
jquery 的 $("#id").html() 無內(nèi)容的解決方法
今天在做一個輸入用到j(luò)query的.html方法,可是用.html()輸不出來2010-06-06
jQuery實(shí)現(xiàn)圖片信息的浮動顯示實(shí)例代碼
圖片信息的浮動顯示的效果,在網(wǎng)頁應(yīng)用中還是比較流行的,下面為大家詳細(xì)介紹下使用jquery是如何實(shí)現(xiàn)的,喜歡的朋友可以參考下2013-08-08
jquery在啟動頁面時(shí),自動加載數(shù)據(jù)的實(shí)例
下面小編就為大家分享一篇jquery在啟動頁面時(shí),自動加載數(shù)據(jù)的實(shí)例,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-01-01
Jquery EasyUI實(shí)現(xiàn)treegrid上顯示checkbox并取選定值的方法
這篇文章主要介紹了Jquery EasyUI實(shí)現(xiàn)treegrid上顯示checkbox并取選定值的方法的相關(guān)資料,需要的朋友可以參考下2016-04-04
關(guān)于hashchangebroker和statehashable的補(bǔ)充文檔
我覺得之前寫的兩篇隨筆有點(diǎn)不負(fù)責(zé)任,完全沒寫明白,補(bǔ)充了一份文檔(權(quán)且算是文檔吧=.=)2011-08-08

