UniversalDashboard.UDGantt

Adds a Google Gantt Chart Component
psdevuk Augustin Ziegler
save_alt 7 downloads

UD-Gantt

Google gantt chart to universaldashboard to better plan tasks and projects, as well as map timelines and critical paths.

Parameters for New-UDGantt

Please note that there are two functions in this component the following parameter set is for New-UDGantt

  • -Width Allows you to set the width of the gantt chart, this is a string so an input of "80%" or "500px" is valid
  • -Height Allows you to set the height of the gantt chart, this is a string so an input of "300px" is valid
  • -CriticalPathEnabled will decide if the critical path is enabled this is a boolean value so either $true or $false is valid
  • -CriticalStrokeColor decides the colour of the critical stroke, this is a string so '#e64a19' input is valid
  • -GridStrokeWidth sets the stroke width on the grid that the gantt chart is displayed in. This is an integer value such as 2
  • -CriticalStrokeWidth sets the stroke width of the critical path arrows this is an integer so 5 is a valid input
  • -GridStrokeColor sets the boarder stroke colour of the grid this is a string so "#000" is a valid input
  • -InnerGrid sets the innergrid colour of the grid this is a string so '#fff3e0' is valid
  • -InnerGridDark sets the innergrid darker colour of the grid this is a string so'#ffcc80' is valid

Demo

Import-Module -Name Universaldashboard
Import-Module -Name UniversalDashboard.UDGantt

Get-UDDashboard | Stop-UDDashboard

$theme = New-UDTheme -Name 'Basic' -Definition @{
    'main' = @{
        'padding-left'   = '5px'
        'padding-right'  = '5px'
        'padding-top'    = '5px'
        'padding-bottom' = '5px'
    }
} -Parent 'Default'
Start-UDDashboard -Port 10000 -AutoReload -Dashboard (
    New-UDDashboard -Title 'Powershell UniversalDashboard' -Theme $theme -Content {
        New-UDRow -Columns {
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt"
                New-UDGantt -Id "Simple" -Width "85%" -Height "270px" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Start (Get-Date).AddDays(6) -End (Get-Date).AddDays(7) -PercentComplete 78 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(8) -PercentComplete 65 -Dependencies "Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(9) -PercentComplete 0 -Dependencies "Test,Build"
                }
            }

            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt Critical Path Enabled"
                New-UDGantt -Id "Simple2" -Width "85%" -Height "270px" -CriticalPathEnabled $true -CriticalStrokeColor '#e64a19' -GridStrokeWidth 1 -CriticalStrokeWidth 4 -GridStrokeColor "#ccc" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component"  -End (Get-Date).AddDays(7) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78 -Dependencies "Research"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(11) -Duration (4 * 24 * 60 * 60 * 1000) -PercentComplete 65 -Dependencies "Write,Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Start (Get-Date).AddDays(11) -End (Get-Date).AddDays(12) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0 -Dependencies "Test,Build"
                }
            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Gantt With Styling Applied and Critical Path"
                New-UDGantt -Id "Simple3" -Width "85%" -Height "270px" -CriticalPathEnabled $true -CriticalStrokeColor '#e64a19' -GridStrokeWidth 2 -CriticalStrokeWidth 5 -GridStrokeColor "#000" -InnerGrid '#fff3e0' -InnerGridDark '#ffcc80' -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Start (Get-Date).AddDays(6) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(8) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 65 -Dependencies "Write,Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(9) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0 -Dependencies "Test,Build"
                }
            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt With Resource Parameter"
                New-UDGantt -Id "Simple4" -CriticalPathEnabled $false -CriticalStrokeColor '#ccc' -GridStrokeWidth 15 -Width "85%" -Height "270px" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Resource "research" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Resource "write" -Start (Get-Date).AddDays(6) -End (Get-Date).AddDays(8) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Resource "build" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(10) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 65 -Dependencies "Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Resource "test" -Start (Get-Date).AddDays(10) -End (Get-Date).AddDays(11) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0 -Dependencies "Test,Build"
                }


            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt Grouping"
                New-UDGantt -Id "Simple5" -CriticalPathEnabled $false -CriticalStrokeColor '#ccc' -GridStrokeWidth 15 -Width "85%" -Height "270px" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Resource "research" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Resource "research" -Start (Get-Date).AddDays(6) -End (Get-Date).AddDays(7) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Resource "research" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(8) -Duration (4 * 24 * 60 * 60 * 1000) -PercentComplete 65 -Dependencies "Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Resource "test" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(9) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0 -Dependencies "Test,Build"
                }


            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt With Resource Parameter"
                New-UDGantt -Id "Simple6" -Width "85%" -Height "270px" -CriticalPathEnabled $true -CriticalStrokeColor '#e64a19' -GridStrokeWidth 2 -CriticalStrokeWidth 4 -GridStrokeColor "#000" -InnerGrid '#9e788f' -InnerGridDark '#474954' -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Resource "research" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92 -Dependencies "Research"
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Resource "write" -Start (Get-Date).AddDays(6) -End (Get-Date).AddDays(7) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Resource "build" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(8) -Duration (4 * 24 * 60 * 60 * 1000) -PercentComplete 65 -Dependencies "Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Resource "write" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(9) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0 -Dependencies "Test,Build"
                }


            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Simple Gantt With No Dependencies"
                New-UDGantt -Id "Simple7" -CriticalPathEnabled $false -CriticalStrokeColor '#ccc' -GridStrokeWidth 15 -Width "85%" -Height "270px" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Start (Get-Date) -End (Get-Date).AddDays(5) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Resource "research" -Start (Get-Date).AddDays(5) -End (Get-Date).AddDays(6)  -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 92
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Resource "write" -Start (Get-Date).AddDays(6) -End (Get-Date).AddDays(7) -Duration (2 * 24 * 60 * 60 * 1000) -PercentComplete 78
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Resource "build" -Start (Get-Date).AddDays(7) -End (Get-Date).AddDays(8) -Duration (4 * 24 * 60 * 60 * 1000) -PercentComplete 65
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Resource "test" -Start (Get-Date).AddDays(8) -End (Get-Date).AddDays(9) -Duration (1 * 24 * 60 * 60 * 1000) -PercentComplete 0
                }


            }
            New-UDColumn -Size 12 -Content {
                New-UDHeading -Size 3 -Text "Computed Start End From Duration Gantt"
                New-UDGantt -Id "Simple8" -Width "85%" -Height "270px" -Data {
                    New-UDGanttData -TaskID "Research" -TaskName "Find Component" -Resource "Brain" -Duration (70 * 60 * 1000) -PercentComplete 100
                    New-UDGanttData -TaskID "Write" -TaskName "Write Component" -Resource "write"  -Duration (10 * 60 * 1000) -PercentComplete 100
                    New-UDGanttData -TaskID "Build" -TaskName "Build Component" -Resource "build" -Duration (20 * 60 * 1000) -PercentComplete 100 -Dependencies "Write"
                    New-UDGanttData -TaskID "Test" -TaskName "Test Component" -Resource "testing" -Duration (35 * 60 * 1000) -PercentComplete 50 -Dependencies "Build"
                    New-UDGanttData -TaskID "Complete" -TaskName "Submit Component" -Resource "publish" -Duration (5 * 60 * 1000) -PercentComplete 0 -Dependencies "Test"
                }
            }

        }
    }
)
Install

Install-Module UniversalDashboard.UDGantt
Version

1.0.0

Last Updated

2/10/2020 9:00:20 PM +00:00

Tags

universaldashboard ud-dashboard ud-component

Author

psdevuk Augustin Ziegler

Type

extension Control

License

Free