预览图:
代码部分:
var typeTitle=['1212','22','33','1212','22','33']
var typeValue=['122','22','33','122','22','33']
option = {
tooltip: {
trigger: "axis",
axisPointer: {
z: 1,
type: "shadow",
shadowStyle:{
shadowColor: '#EBF5FF'
}
}
},
legend: {},
grid: {
left: '5%',
right: '7%',
top: '10%',
bottom: '8%',
containLabel: true
},
xAxis: {
name:'(类别)',
data: typeTitle,
splitLine: {
show: false
},
axisTick: {show: false},
axisLine:{
show: true,
lineStyle: {
type: "solid",
color: "#D9D9D9"
}
},
axisLabel:{
interval:0,
textStyle:{color:"#303032"}
}
},
yAxis: {
name:'(数量)',
splitLine:{
show: true,
lineStyle: {
type: "dashed",
color: '#D9D9D9'
}
},
axisLine:{
show: true,
lineStyle: {
type: "solid",
color: "#D9D9D9"
}
},
axisLabel:{
interval:0,
textStyle:{
color:"#94989C"
}
}
},
series: [
{
// name: '类别',
type: 'bar',
barMaxWidth: 26,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#7EC45E'
},
{
offset: 1,
color: '#4BC3A9'
}
], false)
}
},
data: typeValue
}]
};