# 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) | (None) |
| MouseExit | (None) | (None) | (None) |
| Opening | (None) | (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 |
| --- | :---: | :---: | --- |
| AddItem | item as GraffitiOrgChartItem | (None) | Adds the specified item as a child of the root node. |
| Constructor | (None) | (None) | Creates a new instance of the class. |
| fromJSON | data as JSONItem | (None) | Loads items from a JSONItem. |
| Item | index as Integer | GraffitiOrgChartItem | Returns the item specified by the index. |
| LastIndex | (None) | Integer | Returns the index of the last child of the root node. |
| RemoveAll | (None) | (None) | Removes all items. |
| RemoveItem | item as GraffitiOrgChartItem | (None) | Removes the item specified by index. |
| RemoveItem | index as Integer | (None) | Removes the item specified by index. |
| ResetView | (None) | (None) | Resets the view to center the chart. |
| ScrollTo | item as GraffitiOrgChartItem = Nil | (None) | Scrolls to the specified node. If item is Nil the root node is centered. |
| toJSON | (None) | JSONItem | Exports the current items to a JSONItem. |
| Zoom | level as Double | (None) | Sets the Zoom level with 1.0 being a 1:1 object size ratio. |
| ZoomIn | (None) | (None) | Zooms in. |
| ZoomOut | (None) | (None) | Zooms out. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| RootNodeContent | String | (None) | Text displayed in the root node. |
| RootNodeTitle | String | (None) | Text displayed as the title of the root node. |
| SelectedItem | GraffitiOrgChartItem | (None) | The currently selected item. |