Not able to do panning in diagram


I set diagram.contentAlignment=go.Spot.Top. But after setting this property, i am enable to do panning.
Please help.

I assume you meant to write “unable”.

That is correct – setting Diagram.contentAlignment means you want to limit scrolling/panning in order to keep that Spot of the documentBounds “fixed”.

Perhaps you want to set Diagram.initialContentAlignment instead?

Sorry walter,
Yes, i mean to say unable.
But is there any way, so that i can again enable panning after setting contentAlignment property.

Set Diagram.contentAlignment back to its default value, go.Spot.Default.

Hi walter,

Thanks for the reply.

Is there any workaround in which i can achieve both of the following:-

  1. diagram.contentAlignment=go.Spot.Top
  2. Enable Panning.


I’ll assume Diagram.contentAlignment == go.Spot.Top.

If the Diagram.scale is zoomed in enough so that scroll bars appear, the user will be able to pan or scroll.

If the diagram is zoomed out enough so that the Diagram.documentBounds fits within the Diagram.viewportBounds, then there are no scroll bars and the user cannot scroll or pan. The document bounds (i.e. the content) will be fixed at the middle-top part in the viewport.