Skip to content

LinePlot

ClassChartGuruChartGuru
public class LinePlot : ChartMark, IChartMark, IGeneratedChartContent

A vectorized line plot that renders a mathematical function. Swift Charts equivalent: LinePlot(x: "x", y: .linearFunction(intercept: 0, slope: 1))

Unlike LineMark which requires explicit data points, LinePlot samples a function over a domain to generate a smooth curve.

LinePlot(Func<float, float>, float, float)

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

Creates a LinePlot with a function and domain.

Parameters

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

LinearFunction(float, float, float, float)

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

Creates a linear function plot: y = slope * x + intercept Swift Charts equivalent: LinePlot(x: “x”, y: .linearFunction(intercept:slope:))

Parameters

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

Returns

ChartGuru.LinePlot

QuadraticFunction(float, float, float, float, float)

Section titled “QuadraticFunction(float, float, float, float, float)”
public static LinePlot QuadraticFunction(float a, float b, float c, float domainMin = 0, float domainMax = 1)

Creates a quadratic function plot: y = ax² + bx + c

Parameters

NameType
aSystem.Single
bSystem.Single
cSystem.Single
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.LinePlot

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

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

Creates a sine wave plot.

Parameters

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

Returns

ChartGuru.LinePlot

CosineWave(float, float, float, float, float)

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

Creates a cosine wave plot.

Parameters

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

Returns

ChartGuru.LinePlot

ExponentialFunction(float, float, float, float)

Section titled “ExponentialFunction(float, float, float, float)”
public static LinePlot ExponentialFunction(float a = 1, float b = 1, float domainMin = 0, float domainMax = 2)

Creates an exponential function plot: y = a * e^(b*x)

Parameters

NameType
aSystem.Single
bSystem.Single
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.LinePlot

LogarithmicFunction(float, float, float, float)

Section titled “LogarithmicFunction(float, float, float, float)”
public static LinePlot LogarithmicFunction(float a = 1, float b = 0, float domainMin = 0.1, float domainMax = 10)

Creates a logarithmic function plot: y = a * ln(x) + b

Parameters

NameType
aSystem.Single
bSystem.Single
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.LinePlot

public IEnumerable<LineMark> GetSampledMarks()

Samples the function and generates LineMark data points.

Returns

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

public IEnumerable<IChartMark> GetGeneratedMarks()

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

Returns

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

public IEnumerable<DataPoint> GetSampledPoints()

Gets the sampled data points.

Returns

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

public LinePlot Domain(float min, float max)

Sets the Domain (X range) for sampling.

Parameters

NameType
minSystem.Single
maxSystem.Single

Returns

ChartGuru.LinePlot

public LinePlot Samples(int count)

Sets the number of sample points.

Parameters

NameType
countSystem.Int32

Returns

ChartGuru.LinePlot

public LinePlot InterpolationMethod(InterpolationMethod method)

Sets the interpolation method.

Parameters

NameType
methodChartGuru.InterpolationMethod

Returns

ChartGuru.LinePlot

public LinePlot LineStyle(float width)

Sets the line width.

Parameters

NameType
widthSystem.Single

Returns

ChartGuru.LinePlot

public LinePlot ForegroundStyle(Color color)

Sets the foreground color. Swift Charts equivalent: .ForegroundStyle(color)

Parameters

NameType
colorUnityEngine.Color

Returns

ChartGuru.LinePlot

public LinePlot Symbol(SymbolShape shape, float size = 4)

Shows points at each sample.

Parameters

NameType
shapeChartGuru.SymbolShape
sizeSystem.Single

Returns

ChartGuru.LinePlot

public LinePlot Symbol(SymbolStyle style, float size = 4)

Shows stroked-border points at each sample. Swift Charts equivalent: .Symbol(.circle.StrokeBorder(lineWidth: 2)).

Parameters

NameType
styleChartGuru.SymbolStyle
sizeSystem.Single

Returns

ChartGuru.LinePlot

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 Line 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 float DomainMin { get; set; }

Minimum X value for sampling.

Returns

System.Single

public float DomainMax { get; set; }

Maximum X value for sampling.

Returns

System.Single

public int SampleCount { get; set; }

Number of sample points to generate. Higher values produce smoother curves.

Returns

System.Int32

public InterpolationMethod Interpolation { get; set; }

Returns

ChartGuru.InterpolationMethod

public float LineWidth { get; set; }

Returns

System.Single

public bool ShowPoints { get; set; }

Returns

System.Boolean

public SymbolShape PointSymbol { get; set; }

Returns

ChartGuru.SymbolShape

public float PointSize { get; set; }

Returns

System.Single