dabeng / OrgChart.js

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zoomoutLimit缩放bug

coder-stan-lv opened this issue · comments

@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

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.