# GraffitiOrgChart
Class Inherits GraffitiWebUIControl
## About
GraffitiOrgChart is a simple yet powerful class to display interactive data in a hierarchical manner in your user interface. This class supports adding and removing nodes by the user, as well as editing node content at runtime.
## Preview


Previous
Next
## Warnings
### Linux Support
Support varies by Linux distribution and installed libwebkit library and version.
### Windows Support
Requires the presence of an HTMLViewer on a window or container within the project.
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Directions | TopToBottom <br> BottomToTop <br> LeftToRight <br> RightToLeft | Supported display directions. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ItemAdded | item as GraffitiOrgChartItem | (None) | Raised when the user adds an item using the + button on an existing item. |
| ItemContentChanged | item as GraffitiOrgChartItem | (None) | Raised when user has edited an item's text. |
| ItemDragged | item as GraffitiOrgChartItem <br> newParent as GraffitiOrgChartItem | (None) | Raised when the user has changed the location of an item by dragging with the mouse. |
| ItemRemoved | item as GraffitiOrgChartItem | (None) | Raised when the user has removed an item using the × button. |
| ItemTitleChanged | item as GraffitiOrgChartItem | (None) | Raised when the user has changed the title of an existing item. |
| MouseEnter | (None) | (None) | |
| MouseExit | (None) | (None) | |
| Opening | (None) | (None) | |
| SelectionChanged | (None) | (None) | Raised when the user selects an item. |
| Shown | (None) | (None) | Raised when the control is ready for interaction. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Sub | AddItem | (None) | Adds the specified item as a child of the root node. |
| Sub | Constructor | (None) | Creates a new instance of the class. |
| Sub | fromJSON | (None) | Loads items from a JSONItem. |
| Function | Item | As | Returns the item specified by the index. |
| Function | LastIndex | As | Returns the index of the last child of the root node. |
| Sub | RemoveAll | (None) | Removes all items. |
| Sub | RemoveItem | (None) | Removes the item specified by index. |
| Sub | RemoveItem | (None) | Removes the item specified by index. |
| Sub | ResetView | (None) | Resets the view to center the chart. |
| Sub | ScrollTo | (None) | Scrolls to the specified node. If item is Nil the root node is centered. |
| Function | toJSON | As | Exports the current items to a JSONItem. |
| Sub | Zoom | (None) | Sets the Zoom level with 1.0 being a 1:1 object size ratio. |
| Sub | ZoomIn | (None) | Zooms in. |
| Sub | ZoomOut | (None) | Zooms out. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Private | As | = | |
| Private | As | = | |
| Private | | GraffitiOrgChartItem | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| RootNodeContent | String | Nil | Text displayed in the root node. |
| RootNodeTitle | String | Nil | Text displayed as the title of the root node. |
| SelectedItem | GraffitiOrgChartItem | Nil | The currently selected item. |