如何在Balkangraph orgchart中“修复缩放功能”错误?

时间:2019-08-29 11:50:05

标签: charts orgchart

当我初始化巴尔干orgchart时。它适合屏幕,但初始化时需要缩小。但是当我用代码中提到的图表变量调用缩放功能时,会抛出错误。

图表。缩放比例(0.5)

var chart = new OrgChart(document.getElementById("tree"), {
                        template: "rony",
                        nodeMouseClick: OrgChart.action.none,
                        mouseScrool: OrgChart.action.zoom,
                        align: OrgChart.ORIENTATION,
                        enableSearch: false,
                        showXScroll: OrgChart.none,
                        toolbar: {
                            zoom: true,
                            fit: true,
                            expandAll: false
                        },
                        collapse: {
                            level: 2,
                            allChildren: true
                        },
                        nodeBinding: {
                            field_0: "name",
                            field_1: "title",
                            field_2: "department",
                            img_0: "img",
                            field_number_children: "field_number_children"
                        },
                        nodes: nodes
                    });

我希望输出在初始化时会缩小图表。

1 个答案:

答案 0 :(得分:0)

此处是Balkan图形开发人员

使用scaleInitial选项:

 var chart = new OrgChart(document.getElementById("tree"), {
            ...
            scaleInitial: 0.5
 });