2016-11-09 76 views
0

我有概述如下图:如何防止图中不必要的滚动?

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 }); 

这之后我看到一个图,但有不必要的滚动和它存在于概述: enter image description here

如何禁用此滚动?我想有一个固定的图表区域。

我也看到图有一个额外的空间: enter image description here

这是什么空间?是否有可能没有这个空间的图表,例如http://gojs.net/latest/samples/orgChartStatic.html

+0

怎样才能重现此问题?我修改了组织结构图(静态)示例,以提供“概览200像素高度”和“100像素宽度”(如截图),而且我无法在“概览”图表的文档边界之外滚动图表的视口。 顺便说一句,如果您使用我们的论坛,您可能会得到更快的回复:https://forum.nwoods.com/c/gojs –

回答

0

尝试设置“allowHorizo​​ntalScroll:假”和“allowVerticalScroll:假”当你定义图表因此,它将成为: 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 });