简体   繁体   English

如何在echarts中放置xaxis的中心

[英]how to put bars center of xaxis in echarts

I am using echarts and I am trying to put bars center of each xaxis category 我正在使用echarts,并且试图将条形图放置在每个xaxis类别的中心

this is my chart : 这是我的图表:

在这里的图表

I would like to each of bars match with xaxis label and center of category (exactly like thrid bar only third bar is correct) 我希望每个条形都与xaxis标签和类别中心匹配(就像第三条正确,只有第三条正确)

the red square shows extra space on xaxis 红色方块在xaxis上显示多余的空间

how can I do this? 我怎样才能做到这一点? is there any option for this? 有什么选择吗?

Try adding barGap: '-100' on stacked bar series items 尝试在堆叠的bar系列项目上添加barGap:'-100'

     option = {
    series: [{
    type: 'bar',
    stack: 'whatever',
    barGap: '-100'
    }]
    };
myChart.setOption(option);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM