Skip to content

AxisValue

StructChartGuruChartGuru
public struct AxisValue

Represents a value at an axis mark position. Swift Charts equivalent: AxisValue in AxisMarks { value in … } Access to the value and formatting utilities.

AxisValue(float, int, string, PlottableType)

Section titled “AxisValue(float, int, string, PlottableType)”
public AxisValue(float value, int index, string formatted, PlottableType type = PlottableType.Quantitative)

Creates a numeric axis tick with its generated index, formatted label, and scale classification. The sequence count is left unknown.

Parameters

Name Type
value System.Single
index System.Int32
formatted System.String
type ChartGuru.PlottableType

AxisValue(float, int, int, string, PlottableType)

Section titled “AxisValue(float, int, int, string, PlottableType)”
public AxisValue(float value, int index, int count, string formatted, PlottableType type = PlottableType.Quantitative)

Creates a numeric axis tick with its position in the complete generated tick sequence.

Parameters

Name Type
value System.Single
index System.Int32
count System.Int32
formatted System.String
type ChartGuru.PlottableType
public AxisValue(DateTime dateValue, int index, string formatted)

Creates a temporal axis tick that preserves the source date and exposes its tick count as the raw numeric value.

Parameters

Name Type
dateValue System.DateTime
index System.Int32
formatted System.String
public AxisValue(DateTime dateValue, int index, int count, string formatted)

Creates a temporal axis tick with its position in the complete generated tick sequence.

Parameters

Name Type
dateValue System.DateTime
index System.Int32
count System.Int32
formatted System.String
public AxisValue(string categoryValue, int index, int categoryIndex)

Creates a categorical axis tick whose raw coordinate is the category index and whose label is the category text.

Parameters

Name Type
categoryValue System.String
index System.Int32
categoryIndex System.Int32
public AxisValue(string categoryValue, int index, int count, int categoryIndex)

Creates a categorical axis tick with its position in the complete generated tick sequence.

Parameters

Name Type
categoryValue System.String
index System.Int32
count System.Int32
categoryIndex System.Int32

public T? As<T>() where T : struct

Gets the value as the specified type. Swift Charts equivalent: value.as(Float.self)

Returns

System.Nullable{{T}}

public T AsValue<T>() where T : struct

Gets the value as the specified type (non-nullable). Swift Charts equivalent: value.as(Float.self)!

Returns

{T}

public string AsCategory()

Gets the category string Value (for categorical axes).

Returns

System.String

public DateTime? AsDate()

Gets the DateTime Value (for temporal axes).

Returns

System.Nullable{System.DateTime}

public override string ToString()

Returns

System.String

public int Index { get; }

The index of this value in the sequence of axis marks.

Returns

System.Int32

public int Count { get; }

The total number of axis values in the current sequence. Swift Charts equivalent: AxisValue.count.

Returns

System.Int32

public float RawValue { get; }

The raw numeric value.

Returns

System.Single

public string Formatted { get; }

The formatted string representation of the value.

Returns

System.String

public PlottableType Type { get; }

The data type of this value.

Returns

ChartGuru.PlottableType