0

我可以寻求帮助吗?如何使 google 组织结构图看起来更宽?我的意思是线条正在伸展以占据容器的空间,如下图所示。

在此处输入图像描述

编辑:

添加代码

 var dt = new google.visualization.DataTable(data);
                    dt.addColumn('string', 'Name');
                    dt.addColumn('string', 'Manager');
                    dt.addColumn('string', 'ToolTip');

                    dt.addRows(data);




                    var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));

                    chart.draw(dt, {allowHtml:true, allowCollapse:false, size:'small', size: 'medium'});

这是我的 google orgchart,与上面的图片不一样。

在此处输入图像描述

4

2 回答 2

0

在 div 标签中设置大小:

<div id="chart_div" style="height: 200px; width: 800px"></div>
于 2014-12-23T01:39:58.430 回答
0

May i know why have you set 'size' property of google org chart to small as well as medium at the same time ? In your code the size: 'medium' property is overriding the size: 'small' property. You can try size:'large' property. But it will increase the width as well as height of the nodes of org chart.

If you only want to increase the width of all nodes then try overriding the org chart classes :

.google-visualization-orgchart-table tr td.google-visualization-orgchart-node div { width: 250px!important; }

The above solution worked for me.

于 2019-08-14T13:00:35.780 回答