Expanding to a particular chart node

You can open a particular chart node in the tree or organization chart on a visual dashboard programmatically. See an example of expanding or collapsing the chart nodes on the basis of the DEMO.EMPLOYEE example project.

Before you begin

You must have a visual dashboard with an added Organization Chart or Tree Chart.

About this task

To open a particular chart node in the tree or organization chart:

Procedure

  1. In the DEMO.EMPLOYEE example project, add the Combo Box object.
  2. In the Combo wizard, specify the Query1 that is used for the OrganizationChart1.
  3. Add EMPLOYEE_ID column values to the Combo Box.
  4. Expand OrganizationChart1 component, DataTemplate1(Query1), Leve11, and then select Label1.
  5. Modify its Frame.FillStyle.FillColor property by adding an expression: =if(EMPLOYEE_ID=Combo1.Selection,#F00000,#78b1ea). To highlight the node after selecting it.
    Note: The separator in the expression depends on the locale settings.
  6. Add the Set Values action for the Change event of the Combo Box object:
    OrganizationChart1.DataLocator.CollapsedNodes=field("Query1","EMPLOYEE_ID")
    OrganizationChart1.DataLocator.ExpandedNodes=Combo1.Selection
    OrganizationChart1.DataLocator.CollapsedNodes=Combo1.Selection
  7. Click Runtime tab. Select the required IDs from the Combo Box object, the proper nodes will be expanded and highlighted with red.