echartsx坐标位置怎么修改
不要紧贴y轴
尝试了boundaryGap:true, 但是距离y轴又太远了
尝试了 margin 但是只有左边有距离右边没有
option = {
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// lineStyle: {
// color: '#dddc6b'
// }
// }
// },
// legend: {
// top:'0%',
// data:['WEB','APP'],
// textStyle: {
// color: 'rgba(255,255,255,.5)',
// fontSize:'12',
// }
// },
grid: {
left: '10',
top: '30',
right: '10',
bottom: '10',
containLabel: true
},
xAxis: [{
type: 'category',
boundaryGap:true,
axisTick: {
alignWithLabel: true
},
axisLabel: {
textStyle: {
color: "rgba(255,255,255,.6)",
fontSize:12,
},
},
// axisLine: {
// lineStyle: {
// color: 'rgba(255,255,255,.2)'
// }
// },
data: ['摄像头', '网络交换机', '风扇', '硬盘录像机',]
}, {
}],
yAxis: [{
type: 'value',
axisTick: {show: false},
axisLine: {
lineStyle: {
color: 'rgba(255,255,255,.1)'
}
},
axisLabel: {
margin:0,
textStyle: {
color: "rgba(255,255,255,.6)",
fontSize:12,
},
},
splitLine: {
lineStyle: {
color: 'rgba(255,255,255,.1)'
}
}
}],
series: [
{
name: 'WEB',
type: 'line',
smooth: true,
// symbol: 'circle',
lineStyle: {
normal: {
color: '#0184d5',
// width: 2
}
},
itemStyle: {
normal: {
color: '#0184d5',
borderColor: 'rgba(221, 220, 107, .1)',
borderWidth: 12,
label:{
show: true,
color:'#0184d5'
}
},
},
data: [3, 4, 3, 4,],
},
{
name: 'APP',
type: 'line',
smooth: true,
symbol: 'circle',
symbolSize: 5,
// showSymbol: false,
lineStyle: {
normal: {
color: '#00d887',
width: 2
}
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(0, 216, 135, 0.4)'
}, {
offset: 0.8,
color: 'rgba(0, 216, 135, 0.1)'
}], false),
shadowColor: 'rgba(0, 0, 0, 0.1)',
}
},
itemStyle: {
normal: {
color: '#00d887',
borderColor: 'rgba(221, 220, 107, .1)',
borderWidth: 12,
label:{
show: true,
color:'#00d887'
}
}
},
data: [5, 3, 5, 6,]
},
]
};
用定位啊 position: relative; top :20% ;left:20%