Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotation().line() 在有数据表现正常,无数据的无法显示 #3576

Closed
NicolaCage opened this issue Aug 18, 2021 · 1 comment
Closed

Comments

@NicolaCage
Copy link

NicolaCage commented Aug 18, 2021

先贴代码哈,实现思路是这样,根据用户自己输入的baseLine参数,设置成三条刻度线,中间为参考线

chartInstance.scale('value', { ticks: [0, baseLine, Math.round(baseLine * 1.5) ] });
chartInstance.annotation().line({
        start: ['min', baseLine],
        end: ['max', baseLine],
        style: {
          stroke: '#e6522b',
          lineWidth: 1,
          lineDash: [3, 3],
          zIndex: 999,
        },

版本:"@antv/g2": "^4.1.22"

这是没有数据的时候
image这是有数据的时候
image
排查的时候发现其实就是在没有数据的时候annotation().line没有生效,我想问下这是g2自身的逻辑吗?还是算一个bug?如果是本身就是这样设计的话,那我们这边需要单独做处理了

@hustcc
Copy link
Member

hustcc commented Sep 30, 2021

没看懂问题是什么?可以再解释下嘛?

@hustcc hustcc closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants