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
- In the
DEMO.EMPLOYEE
example project,
add the Combo Box object.
- In the Combo wizard, specify the Query1 that
is used for the OrganizationChart1.
- Add EMPLOYEE_ID column values to
the Combo Box.
- Expand OrganizationChart1 component, DataTemplate1(Query1), Leve11,
and then select Label1.
- 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.
- 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
- Click Runtime tab. Select the required
IDs from the Combo Box object, the proper nodes
will be expanded and highlighted with red.