Skip to content

AreaPlot

ClassChartGuruChartGuru
public class AreaPlot : ChartMark, IChartMark, IGeneratedChartContent

A vectorized area plot that renders a mathematical function as a filled area. Swift Charts equivalent: AreaPlot(x: "x", y: .linearFunction(...))

AreaPlot(Func<float, float>, float, float)

Section titled “AreaPlot(Func<float, float>, float, float)”
public AreaPlot(Func<float, float> function, float domainMin = 0, float domainMax = 1)

Creates an AreaPlot with a function and domain.

Parameters

NameType
functionSystem.Func{System.Single,System.Single}
domainMinSystem.Single
domainMaxSystem.Single

AreaPlot(Func<float, float>, Func<float, float>, float, float)

Section titled “AreaPlot(Func<float, float>, Func<float, float>, float, float)”
public AreaPlot(Func<float, float> upperFunction, Func<float, float> lowerFunction, float domainMin = 0, float domainMax = 1)

Creates an area between two functions.

Parameters

NameType
upperFunctionSystem.Func{System.Single,System.Single}
lowerFunctionSystem.Func{System.Single,System.Single}
domainMinSystem.Single
domainMaxSystem.Single

LinearFunction(float, float, float, float)

Section titled “LinearFunction(float, float, float, float)”
public static AreaPlot LinearFunction(float intercept, float slope, float domainMin = 0, float domainMax = 1)

Creates a linear function area plot.

Parameters

NameType
interceptSystem.Single
slopeSystem.Single
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.AreaPlot

SineWave(float, float, float, float, float)

Section titled “SineWave(float, float, float, float, float)”
public static AreaPlot SineWave(float amplitude = 1, float frequency = 1, float phase = 0, float domainMin = 0, float domainMax = 6.28)

Creates a sine wave area plot.

Parameters

NameType
amplitudeSystem.Single
frequencySystem.Single
phaseSystem.Single
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.AreaPlot

public IEnumerable<AreaMark> GetSampledMarks()

Samples the function and generates AreaMark data points.

Returns

System.Collections.Generic.IEnumerable{ChartGuru.AreaMark}

public IEnumerable<IChartMark> GetGeneratedMarks()

Expands this function plot through the common generated-content pipeline.

Returns

System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}

public AreaPlot Domain(float min, float max)

Sets the numeric input domain sampled by the plot; values outside the interval are not generated.

Parameters

NameType
minSystem.Single
maxSystem.Single

Returns

ChartGuru.AreaPlot

public AreaPlot Samples(int count)

Sets how many evenly spaced samples are generated across a function plot domain.

Parameters

NameType
countSystem.Int32

Returns

ChartGuru.AreaPlot

public AreaPlot InterpolationMethod(InterpolationMethod method)

Selects how adjacent data points are connected, affecting line and area geometry between samples.

Parameters

NameType
methodChartGuru.InterpolationMethod

Returns

ChartGuru.AreaPlot

public AreaPlot Baseline(float value)

Sets the area baseline; callback overloads evaluate a separate baseline for each sampled X value.

Parameters

NameType
valueSystem.Single

Returns

ChartGuru.AreaPlot

public AreaPlot Baseline(Func<float, float> function)

Sets the area baseline; callback overloads evaluate a separate baseline for each sampled X value.

Parameters

NameType
functionSystem.Func{System.Single,System.Single}

Returns

ChartGuru.AreaPlot

public AreaPlot Opacity(float value)

Configures the alpha multiplier for generated marks; selector overloads evaluate it separately for each datum.

Parameters

NameType
valueSystem.Single

Returns

ChartGuru.AreaPlot

public AreaPlot ShowBoundaryLine(bool show = true, float width = 2)

Shows or hides the sampled area boundary and optionally configures its width.

Parameters

NameType
showSystem.Boolean
widthSystem.Single

Returns

ChartGuru.AreaPlot

public AreaPlot Gradient(bool enabled = true)

Enables or disables the generated area fill gradient.

Parameters

NameType
enabledSystem.Boolean

Returns

ChartGuru.AreaPlot

public AreaPlot ForegroundStyle(Color color)

Sets the foreground color propagated to every generated area sample.

Parameters

NameType
colorUnityEngine.Color

Returns

ChartGuru.AreaPlot

public override (Vector2 source, Vector2 target) GetMorphTargets(ChartType targetType, Rect plotArea)

Projects this mark into plot-space geometry that the morph renderer can interpolate toward the requested chart type.

Parameters

NameType
targetTypeChartGuru.ChartType
plotAreaUnityEngine.Rect

Returns

System.ValueTuple{UnityEngine.Vector2,UnityEngine.Vector2}

public override IChartMark Clone()

Creates an independent copy of this Area Plot; later configuration changes do not affect the original instance.

Returns

ChartGuru.IChartMark

public override ChartType MarkType { get; }

Returns

ChartGuru.ChartType

public Func<float, float> Function { get; set; }

The function to plot: y = f(x)

Returns

System.Func{System.Single,System.Single}

public Func<float, float> BaselineFunction { get; set; }

Optional baseline function for area between two curves. If null, uses the constant Baseline value.

Returns

System.Func{System.Single,System.Single}

public float DomainMin { get; set; }

Returns

System.Single

public float DomainMax { get; set; }

Returns

System.Single

public int SampleCount { get; set; }

Returns

System.Int32

public InterpolationMethod Interpolation { get; set; }

Returns

ChartGuru.InterpolationMethod

public float BaselineValue { get; set; }

Returns

System.Single

public bool ShowLine { get; set; }

Returns

System.Boolean

public float LineWidth { get; set; }

Returns

System.Single

public float FillOpacity { get; set; }

Returns

System.Single

public bool ShowGradient { get; set; }

Returns

System.Boolean