X轴旋转
Page({
getChart2Option: function (chartData) {
var option = {
color: ['#3E92EF'],
tooltip: {},
grid: {
top: "5%",
left: '3%',
right: '3%',
bottom: '3%',
containLabel: true
},
xAxis: {
data: chartData.xData,
type: 'category',
axisTick: {
show: false
},
boundaryGap: [0, 0.1],
**//x轴旋转**
axisLabel: {
interval: 0, //隔几项显示一个标签
rotate: "45" //标签倾斜的角度,旋转的角度是-90到90度
}
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.2],
},
series: [{
data: chartData.seriesData,
type: 'bar',
barWidth: 20,
label: {
normal: {
show: true,
position: 'top',
fontSize: 10,
}
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[{
offset: 0.5,
color: '#3F90EF'
},
{
offset: 0.9,
color: '#00D0E6'
},
]
)
}
},
}]
};
return option
},
});
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62