ECharts- How to show horizontal scroll bar with 3 lines of legend, and after that scroll if items doesn't fit in 3 lines

vecaoik1  于 2022-12-31  发布在  Echarts
关注(0)|答案(8)|浏览(178)

Version

4.2.1

Steps to reproduce

Create a Echarts line chart with 50 series. set to show the legends at top with vertical scroll bar.

What is expected?

Scroll should shown with 3 lines. Every line should show 4 legends. if legends doesn't fit in 3 lines, then show the vertical scroll.

What is actually happening?

Chart is showing vertical scroll with only one item in one line. And it is also overlapping on the chart body.

I tried with vertical and horizontal scroll. In vertical scroll, it shows only one legend in one line. this is the problem. Actually, ECharts should show the what ever possible legends in one line. If there is enough space to have 2 legends in one line, it should show 2 legends in one line. It should show 3 lines and if all legends doesn't fit in three lines, then should add vertical scroll. But, currently legends overlap to chart.

Currntly Happening -

Expected -

insrf1ej

insrf1ej1#

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

Have a nice day! 🍵

gijlo24d

gijlo24d2#

Can anyone please update me on this? If this is possible or not possible, can you please confirm this?

xmd2e60i

xmd2e60i3#

https://echarts.apache.org/en/option.html#legend.type Try legend typed of scroll.

o2g1uqev

o2g1uqev4#

https://echarts.apache.org/en/option.html#legend.type Try legend typed of scroll.

if you check the screenshot, then you can see that we already used the scroll and still we can not achieve what I asked for.

vzgqcmou

vzgqcmou5#

Legend component cannot automatically avoid grid area.

w51jfk4q

w51jfk4q6#

@Ovilia, any updates on this thread?

I'm on v4.6 and I've used scroll on the chart to get something like this:

But I was something like this as per design:

So the legend should scroll horizontally and should have two rows. At the moment, I just get one row.

41ik7eoe

41ik7eoe7#

I am still looking for this feature. Is there any chance that we can get this support from echarts?

krugob8w

krugob8w8#

That would be great to see this feature!

相关问题