跨省流出人群分布洞察表

通过多样性柱状图直观的展现广东省流出到其他一些省份的人数。

数据源:bar.json

要求:

  1. 背景:颜色 #6a7985
  2. x轴:名称“省份”,字体颜色#91d4ff,字体大小14
  3. y轴:名称“万人”,字体颜色和大小同x轴。y轴添加分隔线,分隔线颜色#003982
  4. 柱体宽14,顶部圆角
  5. 柱体颜色渐变:上面#BA55D3,中间#7395ff,底部#0000FF
  6. 柱体透明度 0.85

结果示例:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>跨省流出人群分布洞察表</title>
		<script src="js/echarts.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-1.11.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/dark.js"></script>
	</head>
	<body>
		<div id="main" style="width: 800px;height: 600px;"></div>
		
		<script type="text/javascript">
			var myChart =echarts.init(document.getElementById("main"),'dark');
			
			var option ={
				backgroundColor: "#6a7985",
				xAxis:{
					name:'省份',
				//	data:['湖南省','广西省','江西省','四川省','湖北省','台湾省'],
					nameTextStyle:{
						color:'#91d4ff',
						fontSize:12,
					},
					axisLabel:{
						color:"rgba(110, 240, 255, 0.57)"
					},
					axisLine:{
						show:true,
						color:"rgba(16, 41, 150, 0.6)"
					},
				},
				
				yAxis:{
					name:'万人',
					type: "value",
					show:true,
					nameTextStyle:{
						color:'#91d4ff',
						fontSize:12,
						},
					//y轴分隔线
					 splitLine:{
						  lineStyle:{
							  color:'#003982',
						  }
					 },
					 axisLabel:{
					 	color:"rgba(110, 240, 255, 0.57)"
					 },
					 axisLine:{
					 	show:true,
					 	color:"rgba(0, 0, 143, 1.0)"
					 },
				},
				
			    tooltip:{
					trigger:'axis',
					formatter:'{b}:{c}'
				}, 
				series:[
					{
						type:'bar',
						name:'销量',
						data:[5,20,36,10,10,20],
						opacity:0.85,
						barWidth: 14,
						itemStyle:{
					
							normal:{
								
								borderRadius: [100, 100,0,0],
								
								//渐变
								color:new echarts.graphic.LinearGradient(0,0,0,1,[
									{offset:0,color:'#BA55D3'},
									{offset:0.5,color:'#7395ff'},
									{offset:1,color:'#0000FF'},
								])
						},
							},
					}
					 ]
					};	
				
				var names =[];
				var nums = [];
				//异步调用
			$.get('data/bar.json',function(result){
				$.each(result.list,function(index,item){
					names.push(item.province)
					nums.push({
						value:item.num,
						name:item.province
					});
				});
				option.xAxis.data = names
				option.series[0].data = nums
				myChart.setOption(option)
			})
			
		</script>
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值