Skip to main content

margin

An object with settings of margins for positioning items in the diagram

margin?: IMarginConfig;

Object properties:

  • itemX - horizontal space between two shapes (only for type: "org" | "mindmap")
  • itemY - vertical space between two shapes (only for type: "org" | "mindmap")
  • x - horizontal space between the start of a diagram and the first item
  • y - vertical space between the start of a diagram and the first item

Example

const diagram = new dhx.Diagram("diagram_container", {
type: "org",
margin: {
x: 20, y: 20,
itemX: 50, itemY: 50
}
});

Related sample: Diagram. Org chart mode. Margin between shapes

The default values of margins are:

{ x: 40, y: 40, itemX: 40, itemY: 40 }