OxyPlot.Series.TornadoBarSeries.ps1
Set-StrictMode -Version 3 <# .SYNOPSIS Represents a series that can be used to create tornado plots. See http://en.wikipedia.org/wiki/Tornado_diagram. .PARAMETER Parent Gets the parent model of the element. .PARAMETER BarWidth Sets the width of the bars (as a fraction of the available width). The default value is 0.5 (50%) .PARAMETER BaseValue Sets the base value. .PARAMETER Items Gets the tornado bar items. .PARAMETER LabelColor Sets the label color. .PARAMETER LabelField Sets the label field. .PARAMETER LabelMargin Sets the label margins. .PARAMETER MaximumField Sets the maximum value field. .PARAMETER MaximumFillColor Sets the color of the interior of the Maximum bars. .PARAMETER ActualMaximumFillColor Gets the actual fill color. .PARAMETER MaximumLabelFormatString Sets the format string for the maximum labels. .PARAMETER MinimumField Sets the minimum value field. .PARAMETER MinimumFillColor Sets the default color of the interior of the Minimum bars. .PARAMETER ActualMinimumFillColor Gets the actual minimum fill color. .PARAMETER MinimumLabelFormatString Sets the format string for the minimum labels. .PARAMETER StrokeColor Sets the color of the border around the bars. .PARAMETER StrokeThickness Sets the thickness of the bar border strokes. .PARAMETER ActualMaximumBarRectangles Sets the actual rectangles for the maximum bars. .PARAMETER ActualMinimumBarRectangles Sets the actual rectangles for the minimum bars. .PARAMETER ValidItems Sets the valid items .PARAMETER ValidItemsIndexInversion Sets the dictionary which stores the index-inversion for the valid items .PARAMETER ItemsSource Sets the items source. The default is null. .PARAMETER Background Sets the background color of the series. The default is OxyColors.Undefined. This property defines the background color in the area defined by the x and y axes used by this series. .PARAMETER IsVisible Sets a value indicating whether this series is visible. The default is true. .PARAMETER Title Sets the title of the series. The default is null. .PARAMETER RenderInLegend Sets a value indicating whether the series should be rendered in the legend. The default is true. .PARAMETER TrackerFormatString Sets a format string used for the tracker. The default depends on the series. The arguments for the format string may be different for each type of series. See the documentation. .PARAMETER TrackerKey Sets the key for the tracker to use on this series. The default is null. This key may be used by the plot view to show a custom tracker for the series. .PARAMETER MaxX Sets the maximum x-coordinate of the dataset. .PARAMETER MaxY Sets the maximum y-coordinate of the dataset. .PARAMETER MinX Sets the minimum x-coordinate of the dataset. .PARAMETER MinY Sets the minimum y-coordinate of the dataset. .PARAMETER XAxis Gets the x-axis. .PARAMETER XAxisKey Sets the x-axis key. The default is null. .PARAMETER YAxis Gets the y-axis. .PARAMETER YAxisKey Sets the y-axis key. The default is null. .PARAMETER IsXMonotonic Sets a value indicating whether the X coordinate of all data point increases monotonically. .PARAMETER WindowStartIndex Sets the last visible window start position in the data points collection. .PARAMETER Font Sets the font. The default is null (use OxyPlot.PlotModel.DefaultFont. If the value is null, the DefaultFont of the parent PlotModel will be used. .PARAMETER FontSize Sets the size of the font. The default is double.NaN (use OxyPlot.PlotModel.DefaultFontSize). If the value is NaN, the DefaultFontSize of the parent PlotModel will be used. .PARAMETER FontWeight Sets the font weight. The default is FontWeights.Normal. .PARAMETER PlotModel Gets the parent OxyPlot.PlotElement.PlotModel. .PARAMETER Tag Sets an arbitrary object value that can be used to store custom information about this plot element. The default is null. This property is analogous to Tag properties in other Microsoft programming models. Tag is intended to provide a pre-existing property location where you can store some basic custom information about any PlotElement without requiring you to subclass an element. .PARAMETER TextColor Sets the color of the text. The default is OxyColors.Automatic (use OxyPlot.PlotModel.TextColor). If the value is OxyColors.Automatic, the TextColor of the parent PlotModel will be used. .PARAMETER ToolTip Sets the tool tip. The default is null. .PARAMETER ActualFont Gets the actual font. .PARAMETER ActualFontSize Gets the actual size of the font. .PARAMETER ActualFontWeight Gets the actual font weight. .PARAMETER ActualTextColor Gets the actual color of the text. .PARAMETER ActualCulture Gets the actual culture. The culture is defined in the parent PlotModel. .PARAMETER Selectable Sets a value indicating whether this element can be selected. The default is true. .PARAMETER SelectionMode Sets the selection mode of items in this element. The default is SelectionMode.All. This is only used by the select/unselect functionality, not by the rendering. .PARAMETER ActualSelectedColor Gets the actual selection color. .DESCRIPTION This cmdlet creates an OxyPlot.Series.TornadoBarSeries object. .PARAMETER InputObject Sets the source of the data set. .PARAMETER Minimum Sets the column Minimum of the data set. .PARAMETER Maximum Sets the column Maximum of the data set. .PARAMETER BarBaseValue Sets the column BarBaseValue of the data set. .PARAMETER MinimumColor Sets the column MinimumColor of the data set. .PARAMETER MaximumColor Sets the column MaximumColor of the data set. .PARAMETER Category Sets the column Category of the data set. .PARAMETER Group Specifies groups to which each element of the data set belongs. If this parameter is set, the data set will be grouped by these values, and multiple series will be produced for each group. .PARAMETER MinimumName Specifies a property name of the input objects to be assigned to the column Minimum of the data set. .PARAMETER MaximumName Specifies a property name of the input objects to be assigned to the column Maximum of the data set. .PARAMETER BarBaseValueName Specifies a property name of the input objects to be assigned to the column BarBaseValue of the data set. .PARAMETER MinimumColorName Specifies a property name of the input objects to be assigned to the column MinimumColor of the data set. .PARAMETER MaximumColorName Specifies a property name of the input objects to be assigned to the column MaximumColor of the data set. .PARAMETER CategoryName Specifies a property name of the input objects to be assigned to the column Category of the data set. .PARAMETER GroupName Specifies a property name of the input objects to be treated as groups. If this parameter is set, the data set will be grouped by the values of this property, and multiple series will be produced for each group. .PARAMETER GroupingKeys Specifies effective groups and these order. This option is useful when you will select groups, or specify the order of the groups shown in the legend. .PARAMETER Options Sets properties of the object. .PARAMETER Style Sets a style of the object. .PARAMETER AddTo Specifies a plot model to which the object will be added. .INPUTS You can send any object to the cmdlet as the source of the data set. #> function New-OxyTornadoBarSeries { [cmdletbinding()] [OutputType([OxyPlot.Series.TornadoBarSeries[]], [void])] param( [Parameter(ValueFromPipeline=$true)] [object]$InputObject, [object[]]$Minimum = @(), [object[]]$Maximum = @(), [object[]]$BarBaseValue = @(), [string[]]$MinimumColor = @(), [string[]]$MaximumColor = @(), [string[]]$Category = @(), [string[]]$Group = @(), [string]$MinimumName, [string]$MaximumName, [string]$BarBaseValueName, [string]$MinimumColorName, [string]$MaximumColorName, [string]$CategoryName, [string]$GroupName, [string[]]$GroupingKeys = @(), [object]$BarWidth, [object]$BaseValue, [OxyPlot.Series.TornadoBarItem[]]$Items, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$LabelColor, [System.String]$LabelField, [object]$LabelMargin, [System.String]$MaximumField, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$MaximumFillColor, [System.String]$MaximumLabelFormatString, [System.String]$MinimumField, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$MinimumFillColor, [System.String]$MinimumLabelFormatString, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$StrokeColor, [object]$StrokeThickness, [object]$MaxX, [object]$MaxY, [object]$MinX, [object]$MinY, [System.String]$XAxisKey, [System.String]$YAxisKey, [System.Collections.IEnumerable]$ItemsSource, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$Background, [System.Boolean]$IsVisible, [System.String]$Title, [System.Boolean]$RenderInLegend, [System.String]$TrackerFormatString, [System.String]$TrackerKey, [System.String]$Font, [object]$FontSize, [object]$FontWeight, [System.Object]$Tag, [ValidatePattern('AliceBlue|AntiqueWhite|Aqua|Aquamarine|Automatic|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|Firebrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|Goldenrod|Gray|Green|GreenYellow|Honeydew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Undefined|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen|(#?[0-9a-f]{1,8})')][string]$TextColor, [System.String]$ToolTip, [System.Boolean]$Selectable, [OxyPlot.SelectionMode]$SelectionMode, [OxyPlot.Model]$Parent, [hashtable]$Options = @{}, [string]$Style = "default", [OxyPlot.PlotModel]$AddTo ) begin { if (!(Test-OxyStyleName $Style)) { Write-Error "Unknown style: '$Style'" return } $info = [PSCustomObject]@{ XAxisTitle = "Minimum" YAxisTitle = $null XDataType = $null YDataType = $null GroupName = $GroupName CategoryNames = @() CategoryTitle = $null } if ($PSBoundParameters.ContainsKey("MinimumName")) { $info.XAxisTitle = $MinimumName } if ($PSBoundParameters.ContainsKey("CategoryName")) { $info.CategoryTitle = $CategoryName } $MinimumData = New-Object Collections.Generic.List[object] $MaximumData = New-Object Collections.Generic.List[object] $BarBaseValueData = New-Object Collections.Generic.List[object] $MinimumColorData = New-Object Collections.Generic.List[string] $MaximumColorData = New-Object Collections.Generic.List[string] $CategoryData = New-Object Collections.Generic.List[string] $GroupData = New-Object Collections.Generic.List[string] } process { if ($InputObject -ne $null) { if ($PSBoundParameters.ContainsKey("MinimumName")) { $MinimumData.Add($InputObject.$MinimumName) } if ($PSBoundParameters.ContainsKey("MaximumName")) { $MaximumData.Add($InputObject.$MaximumName) } if ($PSBoundParameters.ContainsKey("BarBaseValueName")) { $BarBaseValueData.Add($InputObject.$BarBaseValueName) } if ($PSBoundParameters.ContainsKey("MinimumColorName")) { $MinimumColorData.Add($InputObject.$MinimumColorName) } if ($PSBoundParameters.ContainsKey("MaximumColorName")) { $MaximumColorData.Add($InputObject.$MaximumColorName) } if ($PSBoundParameters.ContainsKey("CategoryName")) { $CategoryData.Add($InputObject.$CategoryName) } if ($PSBoundParameters.ContainsKey("GroupName")) { $GroupData.Add($InputObject.$GroupName) } } } end { if ($MinimumData.Count -gt 0 -and $Minimum.Count -gt 0) { Write-Error "Data set of 'Minimum' is given in two ways"; return } if ($MaximumData.Count -gt 0 -and $Maximum.Count -gt 0) { Write-Error "Data set of 'Maximum' is given in two ways"; return } if ($BarBaseValueData.Count -gt 0 -and $BarBaseValue.Count -gt 0) { Write-Error "Data set of 'BarBaseValue' is given in two ways"; return } if ($MinimumColorData.Count -gt 0 -and $MinimumColor.Count -gt 0) { Write-Error "Data set of 'MinimumColor' is given in two ways"; return } if ($MaximumColorData.Count -gt 0 -and $MaximumColor.Count -gt 0) { Write-Error "Data set of 'MaximumColor' is given in two ways"; return } if ($CategoryData.Count -gt 0 -and $Category.Count -gt 0) { Write-Error "Data set of 'Category' is given in two ways"; return } if ($GroupData.Count -gt 0 -and $Group.Count -gt 0) { Write-Error "Data set of 'Group' is given in two ways"; return } $MinimumData.AddRange($Minimum) $MaximumData.AddRange($Maximum) $BarBaseValueData.AddRange($BarBaseValue) $MinimumColorData.AddRange($MinimumColor) $MaximumColorData.AddRange($MaximumColor) $CategoryData.AddRange($Category) $GroupData.AddRange($Group) if ($GroupData.Count -gt 0) { $groups = @{} foreach ($e in $GroupData) { $groups[$e] = 1 } if ($GroupingKeys.Count -eq 0) { $GroupingKeys = $groups.Keys | Sort } $grouping = $true } else { $GroupingKeys = @("dummy") $grouping = $false } $dataCount = $MinimumData.Count foreach ($group in $GroupingKeys) { $series = New-Object OxyPlot.Series.TornadoBarSeries if ($grouping) { $series.Title = $group } $catCount = 0; for ($i = 0; $i -lt $dataCount; ++$i) { if ($grouping -and $GroupData[$i] -ne $group) { continue } if ($i -lt $MinimumData.Count) { $MinimumElement = $MinimumData[$i] } else { $MinimumElement = $null } if ($i -lt $MaximumData.Count) { $MaximumElement = $MaximumData[$i] } else { $MaximumElement = $null } if ($i -lt $BarBaseValueData.Count) { $BarBaseValueElement = $BarBaseValueData[$i] } else { $BarBaseValueElement = $null } if ($i -lt $MinimumColorData.Count) { $MinimumColorElement = $MinimumColorData[$i] } else { $MinimumColorElement = $null } if ($i -lt $MaximumColorData.Count) { $MaximumColorElement = $MaximumColorData[$i] } else { $MaximumColorElement = $null } if ($i -lt $CategoryData.Count) { $CategoryElement = $CategoryData[$i] } else { $CategoryElement = $null } Add-OxyTornadoBarSeriesPoint $series $MinimumElement $MaximumElement $BarBaseValueElement $MinimumColorElement $MaximumColorElement ++$catCount } if ($MinimumData.Count -gt 0) { $info.XDataType = Get-ValueType $MinimumData[0] } if ($grouping) { $info.CategoryNames = New-Object Collections.Generic.List[string] for ($i = 0; $i -lt $dataCount; ++$i) { if ($GroupData[$i] -eq $GroupingKeys[0]) { $info.CategoryNames.Add($CategoryData[$i]) } } } $series = $series | Add-Member -PassThru NoteProperty _Info $info Apply-OxyStyle $series $Style $MyInvocation $props = $PROPERTY_HASH["OxyPlot.Series.TornadoBarSeries"] Assign-ParametersToProperties $props $PSBoundParameters $Options $series if ($AddTo -ne $null) { Add-OxyObjectToPlotModel $series $AddTo -NoRefresh } else { $series } } if ($AddTo -ne $null) { $AddTo.InvalidatePlot($true) } } } |