arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
OrgChart - Color Coded
Use CSS classes to color-code nodes by department, role, or any other criteria. Set the className property on each node to apply custom styling.
How it works

Each node has a className property that adds CSS classes to the node. Use these classes to style different types of nodes (e.g., by department, role, or status).

  • gold-level - Executive Team
  • green-level - Middle Management
  • blue-level - Tech Staff
  • red-level - Sales Staff
  • purple-level - Support Staff
Source

<style type="text/css">
            .orgchart .gold-level .title { background-color: #DAA520; }
            .orgchart .gold-level .content { border-color: #DAA520; }
            .orgchart .green-level .title { background-color: #228B22; }
            .orgchart .green-level .content { border-color: #228B22; }
            .orgchart .blue-level .title { background-color: #4169E1; }
            .orgchart .blue-level .content { border-color: #4169E1; }
            .orgchart .red-level .title { background-color: #DC143C; }
            .orgchart .red-level .content { border-color: #DC143C; }
            .orgchart .purple-level .title { background-color: #8B008B; }
            .orgchart .purple-level .content { border-color: #8B008B; }
        </style>

        <pe:orgchart id="orgChart"
                     widgetVar="colorWidget"
                     value="#{colorCodedOrgchartController.colorCodedChart}"
                     nodeId="id"
                     nodeContent="title"
                     nodeTitle="name"
                     style="height:400px">
        </pe:orgchart>
            
Components and more
Use Cases
Documentation pe:orgchart
Attributes (move mouse over the names to see data types)
Name Description
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
chartClassCSS class to apply to the chart container.
depthThe depth of the chart to initially display.Default is 999.
directionThe direction of the chart. 't2b' (top to bottom), 'b2t' (bottom to top), 'l2r' (left to right), 'r2l' (right to left).Default is t2b.
draggableEnable dragging nodes on the chart.Default is false.
exportButtonEnable export button on the chart.Default is false.
exportFileextensionThe file extension for the exported chart.Default is png.
exportFilenameThe filename for the exported chart.Default is OrgChart.
extenderName of javascript function to extend the widget.
firstDefault is 0.
idUnique identifier of the component in a namingContainer.Default is generated.
nodeContentThe node content property name.Default is title.
nodeIdThe node id property name.Default is id.
nodeTitleThe node title property name.Default is name.
panEnable panning on the chart.Default is false.
parentNodeSymbolThe symbol to indicate a node has children.Default is fa-users.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
rowStatePreservedDefault is false.
rowsDefault is 0.
styleInline style of the component.
styleClassStyle class of the component.
toggleSiblingsRespToggle sibling nodes responsively.Default is false.
valueValue of the component.
var
verticalDepthThe depth at which the chart switches to vertical layout.
widgetVarName of the client side widget.
zoomEnable zooming on the chart.Default is false.
zoominLimitThe maximum zoom-in limit.Default is 7.
zoomoutLimitThe maximum zoom-out limit.Default is 0.5.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-06 07:52