What problem does this feature solve?
line线图,业务需求上需要配置最大值和最小值,然后再echarts上绘制,通过官方文档最合适的是line的markLine配置,现在遇到如下问题:
- 因为是多个线图,如果markLine只设置在series第一项中,因为存在legend,这时关闭掉了第一个line,则不显示markLine
- 如果series每项都绘制,则会出现性能上浪费,并且会重叠markLine
当然我知道此设计是合理的,但是我认为这个业务需求也是合理的,echarts方面可有此处的替代方案呢?
What does the proposed API look like?
希望一个全局生效的markLine,可以像title,tooltip那样的配置
4条答案
按热度按时间kwvwclae1#
@qqfei1858 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] echarts how multiple bar charts show only a single markLine
BODY
What problem does this feature solve?
line diagram, business needs to configure the maximum and minimum values, and then draw on echarts, through the official document the most suitable is the markLine configuration of line, now encounter the following problems:
Of course I know this design is reasonable, but I think this business need is also reasonable, is there an alternative here for echarts?
What does the proposed API look like?
I want a global markLine to be able to be configured like title and tooltip
yv5phkfx2#
suggestion: 1) precalculate min and max for all series, 2) add a line with no name and no data 3) add min/max marklines to this extra line
0wi1tuuw3#
建议:1)预先计算所有系列的最小值和最大值,2)添加一条没有名称和数据的行 3)为这个额外的行添加最小值/最大标记线
@helgasoft I know you can do this, but you need to set up the stack, which feels weird, so I mentioned feature issues
7ivaypg94#
@helgasoft I did this the other way around, with stack there was a bar misalignment, I used line, which always felt weird