OxyPlot.Series.FunctionSeries.ps1

Set-StrictMode -Version 3

<#
.SYNOPSIS
 
Represents a line series that generates its dataset from a function.
 
Define f(x) and make a plot on the range [x0,x1] or define x(t) and y(t) and make a plot on the range [t0,t1].
 
.PARAMETER Parent
 
Gets the parent model of the element.
 
.PARAMETER ItemsSource
Sets the items source. The default is null.
 
.PARAMETER CanTrackerInterpolatePoints
Sets a value indicating whether the tracker can interpolate points.
 
.PARAMETER DataFieldX
Sets the data field X. The default is null.
 
.PARAMETER DataFieldY
Sets the data field Y. The default is null.
 
.PARAMETER Mapping
Sets the delegate used to map from OxyPlot.Series.ItemsSeries.ItemsSource to the OxyPlot.Series.DataPointSeries.ActualPoints. The default is null.
 
Example: series1.Mapping = item => new DataPoint(((MyType)item).Time,((MyType)item).Value);
 
.PARAMETER Points
 
Gets the list of points.
 
.PARAMETER ActualPoints
 
Gets the list of points that should be rendered.
 
.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 Color
Sets the color of the curve.
 
.PARAMETER BrokenLineColor
Sets the color of the broken line segments. The default is OxyPlot.OxyColors.Undefined. Set it to OxyPlot.OxyColors.Automatic if it should follow the OxyPlot.Series.LineSeries.Color.
 
Add DataPoint.Undefined in the Points collection to create breaks in the line.
 
.PARAMETER BrokenLineStyle
Sets the broken line style. The default is OxyPlot.LineStyle.Solid.
 
.PARAMETER BrokenLineThickness
Sets the broken line thickness. The default is 0 (no line).
 
.PARAMETER Dashes
Sets the dash array for the rendered line (overrides OxyPlot.Series.LineSeries.LineStyle). The default is null.
 
If this is not null it overrides the OxyPlot.Series.LineSeries.LineStyle property.
 
.PARAMETER Decimator
Sets the decimator.
 
The decimator can be used to improve the performance of the rendering. See the example.
 
.PARAMETER LabelFormatString
Sets the label format string. The default is null (no labels).
 
.PARAMETER LabelMargin
Sets the label margins. The default is 6.
 
.PARAMETER LineJoin
Sets the line join. The default is OxyPlot.LineJoin.Bevel.
 
.PARAMETER LineStyle
Sets the line style. The default is OxyPlot.LineStyle.Automatic.
 
.PARAMETER LineLegendPosition
Sets a value specifying the position of a legend rendered on the line. The default is LineLegendPosition.None.
 
.PARAMETER MarkerFill
Sets the marker fill color. The default is OxyPlot.OxyColors.Automatic.
 
.PARAMETER MarkerOutline
Sets the a custom polygon outline for the markers. Set OxyPlot.Series.LineSeries.MarkerType to OxyPlot.MarkerType.Custom to use this property. The default is null.
 
.PARAMETER MarkerResolution
Sets the marker resolution. The default is 0.
 
.PARAMETER MarkerSize
Sets the size of the marker. The default is 3.
 
.PARAMETER MarkerStroke
Sets the marker stroke. The default is OxyColors.Automatic.
 
.PARAMETER MarkerStrokeThickness
Sets the marker stroke thickness. The default is 2.
 
.PARAMETER MarkerType
Sets the type of the marker. The default is MarkerType.None.
 
If MarkerType.Custom is used, the MarkerOutline property must be specified.
 
.PARAMETER MinimumSegmentLength
Sets the minimum length of the segment.
Increasing this number will increase performance,
but make the curve less accurate. The default is 2.
 
.PARAMETER Smooth
Sets a value indicating whether this OxyPlot.Series.DataPointSeries is smooth.
 
.PARAMETER StrokeThickness
Sets the thickness of the curve.
 
.PARAMETER ActualColor
 
Gets the actual color.
 
.PARAMETER ActualMarkerFill
 
Gets the actual marker fill color.
 
.PARAMETER ActualLineStyle
 
Gets the actual line style.
 
.PARAMETER ActualDashArray
 
Gets the actual dash array for the line.
 
.PARAMETER SmoothedPoints
 
Gets the smoothed points.
 
.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.
 
 
.PARAMETER F
The function f(x).
 
.PARAMETER X0
The start x value.
 
.PARAMETER X1
The end x value.
 
.PARAMETER Fx
The function x(t).
 
.PARAMETER Fy
The function y(t).
 
.PARAMETER T0
The start t parameter.
 
.PARAMETER T1
The end t parameter.
 
.PARAMETER N
The number of points.
 
.PARAMETER Dx
The increment in x or t.
 
.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.
#>

function New-OxyFunctionSeries {
  [cmdletbinding()]
  [OutputType([OxyPlot.Series.FunctionSeries])]
  param(
    [Parameter(ParameterSetName="Explicit", Position=0)]
    [scriptblock]$F,
    [Parameter(ParameterSetName="Explicit", Position=1)]
    [double]$X0,
    [Parameter(ParameterSetName="Explicit", Position=2)]
    [double]$X1,

    [Parameter(ParameterSetName="Implicit", Position=0)]
    [scriptblock]$Fx,
    [Parameter(ParameterSetName="Implicit", Position=1)]
    [scriptblock]$Fy,
    [Parameter(ParameterSetName="Implicit", Position=2)]
    [double]$T0,
    [Parameter(ParameterSetName="Implicit", Position=3)]
    [double]$T1,

    [double]$N = 100,

    [Alias("Dt")]
    [double]$Dx = [double]::NaN,

    [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]$Color,
    [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]$BrokenLineColor,
    [OxyPlot.LineStyle]$BrokenLineStyle,
    [object]$BrokenLineThickness,
    [System.Double[]]$Dashes,
    [System.Action`2[[System.Collections.Generic.List`1[[OxyPlot.ScreenPoint, OxyPlot, Version=1.0.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.List`1[[OxyPlot.ScreenPoint, OxyPlot, Version=1.0.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]]$Decimator,
    [System.String]$LabelFormatString,
    [object]$LabelMargin,
    [OxyPlot.LineJoin]$LineJoin,
    [OxyPlot.LineStyle]$LineStyle,
    [OxyPlot.Series.LineLegendPosition]$LineLegendPosition,
    [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]$MarkerFill,
    [OxyPlot.ScreenPoint[]]$MarkerOutline,
    [System.Int32]$MarkerResolution,
    [object]$MarkerSize,
    [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]$MarkerStroke,
    [object]$MarkerStrokeThickness,
    [OxyPlot.MarkerType]$MarkerType,
    [object]$MinimumSegmentLength,
    [System.Boolean]$Smooth,
    [object]$StrokeThickness,
    [System.Boolean]$CanTrackerInterpolatePoints,
    [System.String]$DataFieldX,
    [System.String]$DataFieldY,
    [System.Func`2[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[OxyPlot.DataPoint, OxyPlot, Version=1.0.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9]]]$Mapping,
    [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
  )

  if (!(Test-OxyStyleName $Style)) {
    Write-Error "Unknown style: '$Style'"
    return
  }

  $series = New-Object OxyPlot.Series.FunctionSeries

  if ([double]::IsNaN($Dx)) {
    if ($PSCmdlet.ParameterSetName -eq "Explicit") {
      $Dx = ($X1 - $X0) / ($N - 1)
    }
    else {
      $Dx = ($T1 - $T0) / ($N - 1)
    }
  }

  $va = New-Object Collections.Generic.List[Management.Automation.PSVariable]
  if ($PSCmdlet.ParameterSetName -eq "Explicit") {
    $va.Add((New-Object Management.Automation.PSVariable "x"))
    for ($i = $X0; $i -le $X1 + $Dx * 0.5; $i += $Dx) {
      $va[0].Value = $i
      $y = [double]($F.InvokeWithContext($null, $va, $null))[0]
      Add-OxyLineSeriesPoint $series $i $y
    }
  }
  else {
    $va.Add((New-Object Management.Automation.PSVariable "t"))
    for ($i = $T0; $i -le $T1 + $Dx * 0.5; $i += $Dx) {
      $va[0].Value = $i
      $x = [double]($Fx.InvokeWithContext($null, $va, $null))[0]
      $y = [double]($Fy.InvokeWithContext($null, $va, $null))[0]
      Add-OxyLineSeriesPoint $series $x $y
    }
  }

  $info = [PSCustomObject]@{
    XAxisTitle = "x"
    YAxisTitle = "y"
    XDataType = [double]
    YDataType = [double]
    GroupName = $null
  }

  $series = $series | Add-Member -PassThru NoteProperty _Info $info

  Apply-OxyStyle $series $Style $MyInvocation

  $props = $PROPERTY_HASH["OxyPlot.Series.FunctionSeries"]
  Assign-ParametersToProperties $props $PSBoundParameters $Options $series

  if ($AddTo -ne $null) {
    Add-OxyObjectToPlotModel $series $AddTo
  }
  else {
    $series
  }
}