希望達到這種效果

但是現在是這種效果

這個柱子直接貼在y軸了,百度了好久,在官網也找不到相關api,求大佬幫助一下,小弟感激不盡,來日必請你去曹縣恰飯
【下面這段代碼可以復制,隨便在echarts官網找個實體復制進去,就是我現在那種效果,希望會的大佬在上面修改一下
】
option = {
title: {
text: '全市評估報表',
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
top: '15%',
left: '1%',
right: '4%',
bottom: '2%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01],
},
yAxis: {
type: 'category',
data: ['2020年1月', '2020年2月', '2020年3月', '2020年4月', '2020年5月', '2020年6月', '2020年7月', '2020年8月'],
},
series: [
{
type: 'bar',
data: [91, 55, 46, 87, 99,100,56,30],
itemStyle: {
emphasis: {
barBorderRadius: 30
},
normal: {
color: new echarts.graphic.LinearGradient(
0, 0.3, 0.8, 1,
[
{offset: 0, color: '#83bff6'},
{offset: 0.5, color: '#40daaf'},
{offset: 1, color: '#03c158'}
]
),
//柱形圖圓角,初始化效果
barBorderRadius:[50, 50, 50, 50],
label: {
show: true,//是否展示
position: 'right',
textStyle: {
fontWeight:'bolder',
fontSize : '12',
color: 'black',
}
}
}
},
}
]
};
uj5u.com熱心網友回復:
……這是柱狀圖,人家的原點就是緊挨著Y軸線的呀。你左邊要是空出那一些,那空出來的代表什么呢?難道你覺得那樣“好看”些????為什么要糾結于實作這種與原功能相背的?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/284972.html
標籤:JavaScript
