API Reference
New-HTMLOrgChart
Creates an HTML organizational chart based on the provided nodes and options.
Remarks
This function generates an interactive HTML organizational chart based on the specified nodes and customization options. Users can define the layout direction, initial visibility level, vertical alignment, and various interactive features like panning, zooming, dragging, and exporting.
Examples
EXAMPLE 1
New-HTML {
New-HTMLOrgChart {
New-OrgChartNode -Name 'CEO' -Title 'Chief Executive Officer' {
New-OrgChartNode -Name 'Manager' -Title 'Manager'
New-OrgChartNode -Name 'Supervisor' -Title 'Supervisor'
New-OrgChartNode -Name 'Employee' -Title 'Employee' {
New-OrgChartNode -Name 'Assistant' -Title 'Assistant'
}
}
} -AllowExport -ExportExtension pdf -Draggable
} -FilePath $PSScriptRoot\OrgChart.html -ShowHTML -Online
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
New-HTMLOrgChart [-AllowExport] [-ChartID <String>] [-ChartNodes <ScriptBlock>] [-Direction <TopToBottom|BottomToTop|LeftToRight|RightToLeft>] [-Draggable] [-ExportExtension <png|pdf>] [-ExportFileName <String>] [-NodeTitle <String>] [-Pan] [-ToggleSiblings] [-VerticalLevel <Int32>] [-VisileLevel <Int32>] [-Zoom] [-ZoomInLimit <Double>] [-ZoomOutLimit <Double>] [<CommonParameters>]
#
All Parameter SetsParameters
- AllowExport SwitchParameter
- Enables the export button for the org chart.
- ChartID String
- Specifies a custom ID for the org chart. If not provided, a random ID will be generated.
- ChartNodes ScriptBlock
- Specifies the nodes to be displayed on the chart. This parameter should contain a script block defining the organizational structure.
- Direction String
- Specifies the layout direction of the chart. Available values are "TopToBottom" (default), "BottomToTop", "LeftToRight", and "RightToLeft".
- Possible values:
TopToBottom,BottomToTop,LeftToRight,RightToLeft - Draggable SwitchParameter
- Enables dragging and dropping nodes within the org chart. Note: This feature is not supported on Internet Explorer.
- ExportExtension Object
- Specifies the format for exporting the org chart. Available values are "png" and "pdf".
- Possible values:
png,pdf - ExportFileName String
- Specifies the filename when exporting the org chart as an image.
- NodeTitle String
- Sets the text content of the title section of each org chart node.
- Pan SwitchParameter
- Enables panning the org chart by mouse drag and drop.
- ToggleSiblings SwitchParameter
- Enables the ability to show/hide left and right sibling nodes by clicking arrows.
- VerticalLevel Int32
- Aligns the nodes vertically starting from the specified level.
- VisileLevel Int32
- Sets the initial visibility level of the org chart.
- Zoom SwitchParameter
- Enables zooming in and out of the org chart using the mouse wheel.
- ZoomInLimit Double
- Sets the maximum zoom-in limit.
- ZoomOutLimit Double
- Sets the maximum zoom-out limit.