echarts-柱状图-柱状阴影
var dom = document.getElementById(“container”);
var myChart = echarts.init(dom);
var app = {};
option = null;
var data = [44, 55, 56, 78, 66, 33, 80, 66, 90];
var xdata = [‘1001-张三’, ‘1002-李四’, ‘1003-王五’, ‘1004-张明’, ‘1005-王晓雷’, ‘1006-张立波’, ‘1007-王丽’, ‘1008-刘文’, ‘1009-陈诚’];
option = {
grid: {
// left: ‘15%’,
bottom:‘14%’,
x:140,
x2:83
},
xAxis: {
data: xdata,
axisLabel: {
textStyle: {
color: ‘#ffffff’,
fontSize:20
},
interval:0,
// rotate:40, //x轴标题倾斜度
},
axisTick: {
show: false
},
axisLine: {
show: false,
},
z: 10,
},
yAxis: {
axisLine: {
show: false,
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: '#ffffff'
}
},
splitLine: {
// 是否显示
show:true,
// 分割线样式
lineStyle:{
// 颜色
color:'#0976b6',
// 透明度
opacity:'1',
}
},
// y轴刻度间隔
minInterval:25,
//左侧标题
name: '咨\n询\n业\n务\n量',
nameTextStyle: {
color: '#fff',
},
position:'left',
nameLocation: 'middle',
nameGap: 45,
nameRotate: 0,
color:'#fff'
},
series: [
{ // For shadow
type: 'bar',
itemStyle: {
normal: {color: 'rgba(0,0,0,0.05)'},
},
barGap:'-100%',
barCategoryGap:'40%',
barWidth:45,
// data: dataShadow,
animation: false
},
{
type: 'bar',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#01ecff'},
{offset: 0.5, color: '#1cc6fa'},
{offset: 1, color: '#3397ea'}
]
),
label: {
show: true,
position: 'top',
color:'#ffffff',
fontSize:21
},
},
emphasis: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#3397ea'},
{offset: 0.7, color: '#1cc6fa'},
{offset: 1, color: '#01ecff'}
]
)
}
},
data: data
}
]
};
if (option && typeof option === “object”) {
myChart.setOption(option, true);
}