React Funnel Pipeline

A simple yet effective funnel chart

Featured image


Thanks for visiting this page. Today is a special day for me, as it is my wifes’ birthday, and I didn’t mess-up this year, I got cards and gifts. I am rubbish with remembering birthdays, maybe that should be my next component, a birthday component? Todays’ blog is about a new component I cooked up and wanted to share this component, and I think writing a quick blog on it is good for others interested in using it.

Why build this component?

Well the other day I was looking at the documentation page for Powershell Universal, and well randomly a word popped into my head funnel I searched for this but got zero results. I thought perfect, I will bring the funnel to the users of Powershell Universal. Hopefully that is a good enough reason, as I am always looking to bring new user interface components to this amazing bit of software.

What does this component do then?

This component will take an input of array data and then display that data in a funnel chart which you have a number or powershell parameters to customise the look and feel of the funnel chart. Below you will see the parameter list, and what each parameter is for

        [string]$Id = (New-Guid).ToString(), #Allows you to give this component an ID to reference it
        [string]$Title, #Shows a title above the funnel chart
        [switch]$showValues, #Shows the actual value in the funnel for which the value represents in the chart
        [switch]$showNames, #Shows the name representing the section of the funnel chart
        [switch]$showRunningTotal,  #Instead of showing the value in the segment it will show the running total of all values underneath it
        [int]$chartWidth, #Numerical value to control the width of the chart
        [int]$chartHeight, #Numerical value to control the height of the chart
        [switch]$heightRelativeToValue, #Each segment will have its own height relative to the value
        [array]$Data, #Mandatory array of data
        [array]$Colors #Mandatory array of colours to render the funnel chart colours

Above I have listed all the parameters I included for this component and used the # comment to give a brief description on what that parameter does to the component if you use it or not.


Demonstration File

I made a super simple CSV for testing purposes which contains the following:


I then wanted to display this data in the funnel chart component


New-UDDashboard -Title "Funnel Demo" -Content {
 $myTable = import-csv C:\adam\scores.csv

foreach($r in $mytable)
    $dataArray += @{
    name = [string]$r.Name
    value = [int]$r.Score

$colors = @('#f14c14', '#f39c35', '#68BC00', '#1d7b63', '#4e97a8', '#4466a3')
New-UDFunnel -ID "FUNNELDEMO" -Title "Funnel Demo" -Colors $colors -showNames -showValues -Data $dataArray -chartWidth 600 -chartHeight 300 -showRunningTotal


Please note how I created the array with a name and value and forced the variable to either be a string or an int I found that if I didn’t do this I didn’t get the component working correctly.


Again it was really nice to find a component with minimal dependencies, this had zero so it allowed me to put it together quite quickly with the demo data provided on the site. As mentioned in my last blog I will look to update my course with new material on how to build custom component in Powershell Universal. I need to do some more studying myself as there is another UDFactory allowing you to customise the framework being used. I will be uploading this component to the powershell gallery very soon and you should see it on the marketplace today.