echarts splitLine lineStyle

Examples - Apache ECharts

					splitLine :
					{
						show : true
					},
					lineStyle : 
					{
						type : 'dashed',
						color : '#5555555'
					}

echarts_03_bar_01.html

<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
	<div id="container" style="height: 100%; background: white;"></div>
	<script type="text/javascript" src="echarts.min.js"></script>
	<script type="text/javascript">
		/*-------------------------- +
		 http://127.0.0.1:8089/PrjJsp/echarts/echarts_03_bar_01.html
		+-------------------------- */
		function randomInt(min, max)
		{
			return min + Math.floor(Math.random() * (max - min + 1));
		}
		var arrData = [];
		for (var i = 0; i < 12; i++)
		{
			arrData.push(randomInt(0, 100));
		}
	
		//
		var dom = document.getElementById("container");
		var myChart1 = echarts.init(dom);
		option =
		{
			grid: {
// 		        show: false,                //是否显示图表背景网格    
// 		        left: '0%',                //图表距离容器左侧多少距离
// 		        right: '40%',              //图表距离容器右侧侧多少距离
// 		        bottom: '3%',              //图表距离容器上面多少距离
// 		        top: 100,                  //图表距离容器下面多少距离
// 		        containLabel: true,        //防止标签溢出  
// 		        backgroundColor:'#555555', //网格背景色,默认透明
		    },
			title :
			{
				text : '某地区降水量',
				subtext : '纯属虚构'
			},
			tooltip :
			{
// 				trigger : 'axis'
			},
			xAxis :
			[
				{
					type : 'category',
					data :
					[
						'1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'
					],
					splitLine :
					{
						show : true
					},
					axisTick :
					{
// 						alignWithLabel : true
					},
					lineStyle : 
					{
						type : 'dashed',
						color : '#5555555'
					}
				}
			],
			yAxis :
			[
				{
					type : 'value',
					splitLine :
					{
						show : true
					},
					splitArea :
					{
						show : true,
					},
					lineStyle : 
					{
						type : 'dashed',
						color : '#5555555'
					}
				}
			],
			series :
			[
				{
					name : '降水量',
					type : 'bar',
					label :
					{
						normal :
						{
							show : true,
							position : 'top'
						}
					},
					itemStyle :
					{
						normal :
						{
							// 定制显示(按顺序)
							color : function(params)
							{
								var colorList =
								[
									'#C33531', '#EFE42A', '#64BD3D', '#EE9201', '#29AAE3', '#B74AE5', '#0AAF9F', '#E89589', '#16A085', '#4A235A', '#C39BD3 ', '#F9E79F', '#BA4A00', '#ECF0F1',
									'#616A6B', '#EAF2F8', '#4A235A', '#3498DB'
								];
								
								return colorList[params.dataIndex]
							},
					
							// 随机显示
							color : function(d)
							{
								return "#" + Math.floor(Math.random() * (256*256*256-1)).toString(16);
							}
						},
					},
					data :
					[
						32.6, 25.9, 39.0, 26.4, 28.7, 70.7, 75.6, 82.2, 48.7, 58.8, 16.0, 32.3
					],
					data : arrData
				}
			]
		};

		if (option && typeof option === "object")
		{
			myChart1.setOption(option, true);
		}
	</script>
</body>
</html>

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值