- 去掉网格线:splitLine
yAxis: [
{
// y轴不显示
axisLine: {
show: false
},
// 刻度不显示
axisTick: {
show: false
},
// 网格线不显示
splitLine: {
show: false
},
// 以上三个都不显示
show: false,
type: 'value'
}
],
- title位置:x
// title: [
// {
// text: 'vvv',
// 设置title的位置
// // x: '20%',
// textAlign: 'center'
// }
// ],
- 图表的位置:grid
grid: [{
top: '10',
width: '80%',
bottom: '16%',
// left: 10,
containLabel: true
}],
- 顺序反转:inserve
xAxis: [
{
type: 'category',
data: this.pvUvInfo.xKeyList,
inverse: true
}
],
- x坐标、y坐标反转
xAxis yAxis中的内容替换就行
- 柱形图四角圆润、添加渐变色、展示柱子的值
如果x坐标、y坐标反转后,设置渐变色 color: new this.echarts.graphic.LinearGradient(0, 0, 1, 0, [{
series: [
{
type: 'bar',
smooth: true,
barWidth: '20%',
data: this.pvUvInfo.valueList,
itemStyle: {
normal: {
// 柱状角成椭圆形
barBorderRadius: 2,
//设置y轴方向的渐变色,
color: new this.echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'blue'
}, {
offset: 1,
color: '#0099FF'
}]),
// 设置柱子顶部展示值
label: {
show: true,
position: 'top'
}
}
}
}
]
- 坐标倾斜:
xAxis: [
{
type: 'category',
// gridIndex: 1,
data: this.beidouTop10.xKeyList,
// inverse: true,
axisLabel: {
interval: 0,
rotate: 40
}
}
],