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

new Chart()时指定宽高,高不能小于100; 但用chart.changeSize指定宽高,高可以小于100 #2215

Closed
LzyGit opened this issue Mar 24, 2020 · 0 comments · Fixed by #2218
Assignees

Comments

@LzyGit
Copy link

LzyGit commented Mar 24, 2020

用以下代码创建chart并设置height时,height如果设置<100的数值无效, 页面查看渲染后得到的canvas元素,height一定是100.

const chart = new G2.Chart({
        container: 'container',
        // autoFit: true,
        height:90,
        width: 401,
    });
...

微信图片_20200324162329


但如果使用changeSize修改宽高,是可以成功设置height<100的数值.

 chart.changeSize(401, 90);
 chart.render();

360截图20200324162356934

我用new Chart设置高度死活不成功, 调试了一下午,快崩溃了,最后发现changeSize居然能成功
请问这是new Chart构造方法的一个bug吗?

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

Successfully merging a pull request may close this issue.

2 participants