Version
5.3.2
Link to Minimal Reproduction
none
Steps to Reproduce
markArea: {
data: [
[
{
name: "受理服务",
xAxis: "普通电话受理",
itemStyle: {
color:"rgba(1, 151, 255, 0.4)"
},
label: {
backgroundColor: "#0197FF",
color: "white",
borderColor: "#0197FF",
borderWidth: 1,
padding: 8,
align: "center"
// width: 120
}
},
{
xAxis: "网点受理"
}
],
[
{
name: "揽收服务",
xAxis: "普通电话受理",
itemStyle: {
color:"rgba(1, 80, 193, 0.4)
},
label: {
backgroundColor: "#0150C1",
color: "white",
borderColor: "#0150C1",
borderWidth: 1,
padding: 8,
align: "center"
// width: 120
}
},
{
xAxis: "网点受理"
}
],
]
}
Current Behavior
the markArea bgcolor is base the x center point,how can it extend left and right area.
Expected Behavior
markArea
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
8条答案
按热度按时间fd3cxomn1#
@Oracimaru It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED
TITLE
[Bug] How to expand the width of the background color in the markArea area
BODY
Version
5.3.2
Link to Minimal Reproduction
none
Steps to Reproduce
Current Behavior
the markArea bgcolor is base the x center point, how can it extend left and right area.
Expected Behavior
markArea
Environment
Any additional comments?
No response
2ekbmq322#
this is the second area.
piztneat3#
https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AegGxA98qBTuUCV0YEfzQAragCnVA4BaA_b0DScoBfUwJ_agBXz-sRrjwAVCPQDWRVKVKMANhFbQA6hDAALADKMARlRtEAZrZ4VHxWAL6hpAAmzIxEANq0ALIwvLC0hgCuVGm0jlRRuYaumbkAYhwQuQDKzDWZ0LQAuiQRJOQ4-Ba6FNR0AG622bStkcGVVISw8bqWVrAxYHHTAIwATAAMPLCbW7ArAKx7ABx7AOx7KyuXAMwbTZHzT7AAtowcplgcVMuouk-LZYzZ7zYEg-ZzcHzaCMF40WAAIkA68qAMBdALDmgEKlBGPKGkbAGIhbf64lxUF7VCg2eGQ3FWejAGycAgIjisLyMAAUK22h25OwOB22GwAdAAWACUCOJULatKsNm8vm6cvm7LMrA4wAaUQAwgymYiAMQbFYATjOZTK2OluPpjI4RARAHdXKTrSqrF5OFEqBw9fbHcazRarTiVV6OD6OM4om4iNybVCQIwolEINBWERjmG5bZ7NBHfQqNAWBwpR7SEJYE6ILHXPHNonnmEm-EcyCabT8V1YDdW6QW7SHv2wbTO7iYXDHYBf40AbKaY90e7tTUXt8Gk8mU6n9-Z2pkstmcvmnHmmm5CsWSncDtcghU-PzECvoNWmDVa6C6_UOo0mo46lZFwrPcf2dV0WCAj0Iyjf0DQRIN_0A29wWg30YzjfZkJBZNU3TTNYGza8rDzBxC2LUty2fKsazrBsNiI2BBzlWU5XHKFlyIM5ryYqFh1xFoQRYp5iV6eFaHZDgRnCEgWjCABuIA
yk9xbfzb4#
可以设置xAxis.axisTick.alignWithLabel为false,让柱子在刻度之间对齐达到效果。https://echarts.apache.org/zh/option.html#xAxis.axisTick.alignWithLabel
5jvtdoz25#
5.3.2
谢谢,我试了下在5.4.2版本确实起作用,5.3.2依旧是上面的样式。另外,如果把bar换成line,它依旧左右留白了,设置boundaryGap:false会让其闭合,但是依旧不是真实的对应关系,有别的配置参数吗
3mpgtkmj6#
可以设置xAxis.axisTick.alignWithLabel为false,让柱子在刻度之间对齐达到效果。https://echarts.apache.org/zh/option.html#xAxis.axisTick.alignWithLabel
非常感谢,type:'bar’可以。type:'line'有实现方式吗
pkbketx97#
markArea的起点和终点在配置的时候xAxis设置缺省可以分别对应到grid的起点和终点,可能更接近你要的效果。
https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AegGxA98qBTuUCV0YEfzQAragCnVA4BaA_b0DScoBfUwJ_agBXz-sRrjwAVCPQDWRVKVKMANhFbQA6hDAALADKMARlRtEAZrZ4VLoAvnxWACbMjEQA2rQAsjC8sLSGAK5UqbSOVJE5hq4ZOQBiHBA5AMrM1RnQtAC6JOEk5Dj4FroU1HQAbrZZtC0RsMEVVISwcbqWVrDRYLHTAIwATAAMPLCbW7ArAKx7ABx7AOx7KyuXAMwbjaNWALaMHKZYHFTLc_MLMfG6X4zX6_H4gqzQRhPGhpQDryoAwF0AsOaAQqVeIDwbAhJgOlMtujwS4qE8qhQbDCwRjSPRgDZOHQOKwvIwABQrbaHNk7A4HbYbAB0ABYAJTDSlWVpi0g2by-LqSqxMsysDjAeqRADCNLpaQAxBsVgBOM6lUpo-VUrUcOgAd1chLN5tgXk4kSoHE1tKtuv1RpNDvNzo4ro4zkibiIbPxGJAjEikQg0FYRGOj3ltns0Do9Co0BYHFFjqx1ogYdcEc2Ud-oUrpAlYopGOwBiINxr6GrlIeNeB9bbpEh0LogF_jQBspij_WKm51YDdU5TCcTSeS-1ZqZ76YyWZzTuyDbPYPzhQXJXXJdKfH5iI6nYwlSq1R7tbQ9YcNuqVhPJWun7b7XOxYGwaPl6z76kc76fgBLpuqG4b7P-lIxnGCZJrAKYrtYdgOFmOZ5se8pFiWcHrBsGEdmKp4Ykg5Hgs0tHoq06I9DCtB2NA2RhCQzShAA3EAA
pzfprimi8#
markArea的起点和终点在配置的时候xAxis设置缺省可以分别对应到grid的起点和终点,可能更接近你要的效果。 https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AegGxA98qBTuUCV0YEfzQAragCnVA4BaA_b0DScoBfUwJ_agBXz-sRrjwAVCPQDWRVKVKMANhFbQA6hDAALADKMARlRtEAZrZ4VLoAvnxWACbMjEQA2rQAsjC8sLSGAK5UqbSOVJE5hq4ZOQBiHBA5AMrM1RnQtAC6JOEk5Dj4FroU1HQAbrZZtC0RsMEVVISwcbqWVrDRYLHTAIwATAAMPLCbW7ArAKx7ABx7AOx7KyuXAMwbjaNWALaMHKZYHFTLc_MLMfG6X4zX6_H4gqzQRhPGhpQDryoAwF0AsOaAQqVeIDwbAhJgOlMtujwS4qE8qhQbDCwRjSPRgDZOHQOKwvIwABQrbaHNk7A4HbYbAB0ABYAJTDSlWVpi0g2by-LqSqxMsysDjAeqRADCNLpaQAxBsVgBOM6lUpo-VUrUcOgAd1chLN5tgXk4kSoHE1tKtuv1RpNDvNzo4ro4zkibiIbPxGJAjEikQg0FYRGOj3ltns0Do9Co0BYHFFjqx1ogYdcEc2Ud-oUrpAlYopGOwBiINxr6GrlIeNeB9bbpEh0LogF_jQBspij_WKm51YDdU5TCcTSeS-1ZqZ76YyWZzTuyDbPYPzhQXJXXJdKfH5iI6nYwlSq1R7tbQ9YcNuqVhPJWun7b7XOxYGwaPl6z76kc76fgBLpuqG4b7P-lIxnGCZJrAKYrtYdgOFmOZ5se8pFiWcHrBsGEdmKp4Ykg5Hgs0tHoq06I9DCtB2NA2RhCQzShAA3EAA
我这个场景是2个以上markArea,带dataZoom条的。因为加宽顶部受理服务滑动时会重叠,所以使用背景色区分。多个的话有别的方式吗