echarts [Feature] 家人们!柱状图中网格线与x轴刻度线、文本位置对齐的问题怎么解决呀

du7egjpx  于 2023-02-04  发布在  Echarts
关注(0)|答案(7)|浏览(307)

What problem does this feature solve?

家人们,我现在遇到了网格线对齐的问题,如果把boundaryGap变成false的话可以实现x轴刻度线、文本、网格线三者对齐,但是这样柱子就会跑到x轴外面

改boundaryGap的方式只适用于折线图,无法解决柱状图中的问题,网上暂时还没找到能用splitline来实现网格线的解决方式

What does the proposed API look like?

希望能有个属性让它自动对齐

weylhg0b

weylhg0b1#

@Break-2020 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

[Feature] The grid lines in the histogram cannot be aligned with the x-axis tick marks and text positions

BODY

What problem does this feature solve?

My family, I am now encountering the problem of aligning the grid lines. If you change the boundaryGap to false, you can achieve the alignment of the x-axis scale lines, text, and grid lines, but then the columns will run outside the x-axis

The method of changing the boundaryGap is only applicable to the line chart, and cannot solve the problem in the histogram. For the time being, there is no solution on the Internet that can use splitline to realize the grid line.

What does the proposed API look like?

I hope there is a property to make it automatically aligned

zed5wv10

zed5wv102#

There may be a solution, but complete reproducible code is needed. Just an image is not enough.

c0vxltue

c0vxltue3#

boundaryGap

sorry,you can visit this link to see the effect

https://codesandbox.io/s/simple-example-of-dataset-forked-hkv2by?file=/index.js

I want to achieve center alignment of splitLine

Now I can only change the boundaryGap, this will make the graph go beyond the axes

llmtgqce

llmtgqce4#

Possible solution - Demo Code
I hope you do not really need the vertical markLines since I couldn't find a way to remove the end-arrows - probably due to a bug or feature deficiency.
You can enable splitLines, but they are category separators and wont sit in the middle.

gc0ot86w

gc0ot86w5#

Possible solution - Demo Code I hope you do not really need the vertical markLines since I couldn't find a way to remove the end-arrows - probably due to a bug or feature deficiency. You can enable splitLines, but they are category separators and wont sit in the middle.

Thank you for your help~This is also a solution, but adding an additional set of series does not feel very appropriate.If I add markline, I also need to add a set of data for this...

ux6nzvsh

ux6nzvsh6#

If I add markline, I also need to add a set of data for this...

MarkLine data can derive from main data - this way

xiozqbni

xiozqbni7#

MarkLine data can derive from main data - this way

I got it. Thank you!

相关问题