Version 1

    In some instances pie charts are better suited than line or bar.  And it just looks cool.     We can use the built in charting of PowerShell to query Orions's database for infomation then powershell charts to draw the pie chart.  Then use the custom html to link to the chart.  To make it dynamic, run the powershell every 5 minutes to keep the chart updated.


    As as example, we used vendor information, but it can really be any swql query.   It also doesn't have to be a pie chart, it can be a small chart, a 3D chart, etc.


    Add-Type -AssemblyName System.Windows.Forms

    Add-Type -AssemblyName System.Windows.Forms.DataVisualization

    $ErrorActionPreference = 'Stop'


    # solarwinds access information

    $hostname = ''


    # load the swis snapin

    if (-not (Get-PSSnapin | ?{ $_.Name -ceq 'SwisSnapin' })) {

        Add-PSSnapin 'SwisSnapin'



    # connect to the solarwinds server

    #$swis = Connect-Swis -Hostname $hostname -Trusted

    $swis = Connect-Swis -Hostname $hostname -Username xxxxxxx -Password yyyyyyyy


    Get-NetIPAddress | Select IPAddress | %{

        $query = 'select Vendor, count(*) as Value

    from Orion.Nodes

    group by Vendor'


        $Datas = Get-SwisData $swis $query



    if (-not $Datas) {}

    else {

    #Write-Output ("Start Manage")

    # create chart object

          $Chart = New-object System.Windows.Forms.DataVisualization.Charting.Chart

          $Chart.Width = 400

          $Chart.Height = 400

          $Chart.Left = 20

          $Chart.Top = 20

    # create a chartarea to draw on and add to chart

          $ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea


    # add data to chart

          #$Cities = @{London=7556900; Berlin=3429900; Madrid=3213271; Rome=2726539; Paris=2188500}


          $Chart.Series["Data"].Points.DataBindXY($Datas.Vendor, $Datas.Value)

          $chart.Series["Data"].ChartType = "Pie"

          $Chart.Series["Data"]["PieLabelStyle"] = "Outside"

          $Chart.Series["Data"]["PieLineColor"] = "Black"

          #$Chart.Series["Data"]["PieDrawingStyle"] = "Concave"

          ($Chart.Series["Data"].Points.FindMaxByValue())["Exploded"] = $true

          $Chart.Series["Data"][‘PieLabelStyle’] = ‘Disabled’

          # Legend

          $Legend = New-Object System.Windows.Forms.DataVisualization.Charting.Legend

          $Legend.IsEquallySpacedItems = $True

          $Legend.BorderColor = 'Black'


          $chart.Series["Data"].LegendText = "#VALX (#VALY)"

          # save chart to file

          $Chart.SaveImage("D:\InetPub\SolarWinds\Orion\Images\Vendor.png", "PNG")