我有以下图表概述:
var $ = go.GraphObject.make;
var diagram =
$(go.Diagram, element[0],{
initialContentAlignment: go.Spot.TopCenter,
initialScale: (pageBodyWidth > 500 ? 1 : 0.6),
contentAlignment: go.Spot.TopCenter,
layout: $(go.LayeredDigraphLayout, { direction: 0 }),
isReadOnly: false,
allowLink: true,
allowClipboard: false,
'animationManager.duration': 200,
'undoManager.isEnabled': false
});
var overview = $(go.Overview, 'diagramOverview', { observed: diagram });
在此之后,我看到一个图表,但有不必要的滚动,它存在于概述中:
如何禁用此滚动?我想要一个固定的图表区域。
这是什么空间?是否可以使用没有此空格的图表,例如http://gojs.net/latest/samples/orgChartStatic.html?
答案 0 :(得分:2)
在定义图表时尝试设置“allowHorizontalScroll:false”和“allowVerticalScroll:false”,这样它将变为:
var $ = go.GraphObject.make;
var diagram =
$(go.Diagram, element[0],{
initialContentAlignment: go.Spot.TopCenter,
initialScale: (pageBodyWidth > 500 ? 1 : 0.6),
contentAlignment: go.Spot.TopCenter,
layout: $(go.LayeredDigraphLayout, { direction: 0 }),
isReadOnly: false,
allowLink: true,
allowClipboard: false,
'animationManager.duration': 200,
'undoManager.isEnabled': false,
allowHorizontalScroll: false,
allowVerticalScroll: false
});
var overview = $(go.Overview, 'diagramOverview', { observed: diagram });