1. 效果图如下所示:
改之前:
改之后:
2. 代码如下:只需要把需要的x轴或者y轴:type:"log",就行
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['面积统计'],
left: 'center',
top: 'bottom'
},
color: ["#c1232b"],
grid: {
left: '3%',
right: '4%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'log',
},
yAxis: {
type: 'category',
data: ["张掖市","武威","天水","庆阳"]
},
series: [
{
name: '参考示例',
type: 'bar',
barWidth: '15',
data: [100,10000,21000,500000]
}
]
};