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

zoomoutLimit缩放bug #44

Open
SharlynnLv opened this issue Jul 9, 2019 · 1 comment
Open

zoomoutLimit缩放bug #44

SharlynnLv opened this issue Jul 9, 2019 · 1 comment

Comments

@SharlynnLv
Copy link

SharlynnLv commented Jul 9, 2019

@dabeng
$('#chart-container').orgchart({
'data': this.datascource,
'nodeContent': 'title',
'pan': true,
'zoom': true,
'toggleSiblingsResp': true
});
使用jquery方式初始化orgchart,缩放功能正常,但是如果在不刷新页面的情况下,将$('#chart-container').html('')清空后再次使用orgchart重新初始化,会提示Uncaught TypeError: Cannot read property 'zoomoutLimit' of undefined

@psby87
Copy link

psby87 commented Jul 22, 2021

hi @coder-stan-lv, to redraw chart, dont empty chart container div using: $('#chart-container').html('')
use this solution:
make chart with empty datasource when your page is ready for first time:

 diagram = $('#OrgChartDiagram__chartContainer').orgchart({
                'data': null,
                'nodeContent': 'title',
                'zoom': true
            });

( digram is a global variable)
then, for further usage just use:
diagram.init({ 'data': datascource });
this will refresh your diagram.

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