Skip to content

AreaPlot

ClassChartGuruChartGuru
public class AreaPlot : ChartMark, IChartMark

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

Name Type
function System.Func{System.Single,System.Single}
domainMin System.Single
domainMax System.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

Name Type
upperFunction System.Func{System.Single,System.Single}
lowerFunction System.Func{System.Single,System.Single}
domainMin System.Single
domainMax System.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

Name Type
intercept System.Single
slope System.Single
domainMin System.Single
domainMax System.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

Name Type
amplitude System.Single
frequency System.Single
phase System.Single
domainMin System.Single
domainMax System.Single

Returns

ChartGuru.AreaPlot

public IEnumerable<AreaMark> GetSampledMarks()

Samples the function and generates AreaMark data points.

Returns

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

public AreaPlot Domain(float min, float max)

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

Parameters

Name Type
min System.Single
max System.Single

Returns

ChartGuru.AreaPlot

public AreaPlot Samples(int count)

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

Parameters

Name Type
count System.Int32

Returns

ChartGuru.AreaPlot

public AreaPlot InterpolationMethod(InterpolationMethod method)

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

Parameters

Name Type
method ChartGuru.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

Name Type
value System.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

Name Type
function System.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

Name Type
value System.Single

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

Name Type
targetType ChartGuru.ChartType
plotArea UnityEngine.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