Skip to main content

Your First Tree Diagram

Let’s create a simple organizational chart to learn TeeTree basics.
1

Create the Tree Component

2

Add Your First Nodes

3

Run and View

Press F9 to run your application. You should see a hierarchical tree diagram with automatic layout!

Adding Connections

Create visual connections between non-hierarchical nodes:

Formatting Nodes

Customize the appearance of individual nodes:

Global Formatting

Apply formatting to all new nodes using GlobalFormat:
Set GlobalFormat properties before adding nodes. Existing nodes are not affected by changes to GlobalFormat.

Working with Text

Nodes support multi-line text:

Interactive Features

Enable Editing

Handle Selection

Mouse Connections

Performance with Many Nodes

When adding many nodes, use BeginUpdate and EndUpdate:
This approach can add 20,000+ nodes in under 100 milliseconds.

Common Patterns

Iterate Through All Nodes

Find a Node

Access Node Hierarchy

Delete Nodes

Layout Customization

Change the child layout algorithm:

Zoom and Scroll

Save and Load

Next Steps

API Reference

Explore all TTree, TTreeNodeShape, and TTreeConnection properties and methods

Advanced Features

Learn about virtual nodes, custom shapes, animations, and more

Database Integration

Use DBTree to automatically generate hierarchies from datasets

Examples

Browse complete example projects and code snippets

Complete Example

Here’s a complete, runnable example:
This example creates a fully functional organizational chart with formatted nodes and automatic hierarchical layout.