Echarts实现柱状图渐变色

源码

option={
				dataset:{
					source:[
					['score','amount','product'],
				    [89,5300,'oppo'],
				    [78,4500,'vivo'],
				    [95,7800,'华为'],
				    [96,8000,'iPhone'],
				    [69,3000,'三星']
				]
		    },
			grid:{containLabel:true},
			xAxis:{name:'销售量'},
			yAxis:{type:'category'},
			visualMap:{
				orient:'horizontal',
				left:'center',
				min:10,
				max:100,
				text:['High Score','Low Score'],
				dimension:0,
				inRange:{
					color:['#D7DA8B', '#E15457']
				}
			},
			series:[
			   {
				    type:'bar',
			        encode:{
			    	    x:'amount',
				        y:'product'
			        }
			    }
			]		};

效果
Echarts实现柱状图渐变色_第1张图片

你可能感兴趣的:(Echarts)