Skip to content

Chart3DMarkExtensions

ClassChartGuruChartGuru.3D
public static class Chart3DMarkExtensions

Swift Charts 3D convenience lifts for common 2D marks. These let authoring code add depth with a single .Z(...) modifier while still producing the native 3D mark types used by the mesh pipeline.

public static PointMark3D Z(this PointMark mark, float z)

Lifts a 2D point into a PointMark3D at depth z with the same X, Y, series, style and symbol key: a set symbol shape becomes the nearest solid, its size in points becomes a diameter in plot units and a symbol rotation turns about Z. Returns null for a null mark.

Parameters

NameType
markChartGuru.PointMark
zSystem.Single

Returns

ChartGuru.PointMark3D

public static PointMark3D Z(this PointMark mark, PlottableValueRef z)

Lifts a 2D point to the depth z holds, as Chart3DMarkExtensions.Z(PointMark, float) does. Numbers convert as they are and dates as seconds since the Unix epoch; a null value gives 0, and text or other values throw an ArgumentException.

Parameters

NameType
markChartGuru.PointMark
zChartGuru.PlottableValueRef

Returns

ChartGuru.PointMark3D

public static Bar3DMark Z(this BarMark mark, float z)

Lifts a 2D bar into a Bar3DMark at depth z with the same X, Y, series and style: its width and height dimensions become the 3D width and depth as shares of a data unit (0.8 when automatic) and its corner radius converts from points to plot units. The 3D bar starts unstacked; returns null for a null mark.

Parameters

NameType
markChartGuru.BarMark
zSystem.Single

Returns

ChartGuru.Bar3DMark

public static Bar3DMark Z(this BarMark mark, PlottableValueRef z)

Lifts a 2D bar to the depth z holds, as Chart3DMarkExtensions.Z(BarMark, float) does. Numbers convert as they are and dates as seconds since the Unix epoch; a null value gives 0, and text or other values throw an ArgumentException.

Parameters

NameType
markChartGuru.BarMark
zChartGuru.PlottableValueRef

Returns

ChartGuru.Bar3DMark

public static Line3DMark Z(this LineMark mark, float z)

Lifts a 2D line point into a Line3DMark at depth z with the same X, Y, series, style, interpolation and tension, and a tube radius of 0.0025 plot units per point of line width, at least 0.006. Returns null for a null mark.

Parameters

NameType
markChartGuru.LineMark
zSystem.Single

Returns

ChartGuru.Line3DMark

public static Line3DMark Z(this LineMark mark, PlottableValueRef z)

Lifts a 2D line point to the depth z holds, as Chart3DMarkExtensions.Z(LineMark, float) does. Numbers convert as they are and dates as seconds since the Unix epoch; a null value gives 0, and text or other values throw an ArgumentException.

Parameters

NameType
markChartGuru.LineMark
zChartGuru.PlottableValueRef

Returns

ChartGuru.Line3DMark

public static Area3DMark Z(this AreaMark mark, float z)

Lifts a 2D area point into an Area3DMark at depth z with the same X, Y, series, style and interpolation, and a slab half thickness of 0.0025 plot units per point of line width, at least 0.01. Returns null for a null mark.

Parameters

NameType
markChartGuru.AreaMark
zSystem.Single

Returns

ChartGuru.Area3DMark

public static Area3DMark Z(this AreaMark mark, PlottableValueRef z)

Lifts a 2D area point to the depth z holds, as Chart3DMarkExtensions.Z(AreaMark, float) does. Numbers convert as they are and dates as seconds since the Unix epoch; a null value gives 0, and text or other values throw an ArgumentException.

Parameters

NameType
markChartGuru.AreaMark
zChartGuru.PlottableValueRef

Returns

ChartGuru.Area3DMark

public static IChartMark[] Z(this CandleStickMark mark, float z, float slot = 1)

Lifts a candlestick into 3D as two marks to add together: a wick rule from its low to its high and a body box from its open to its close, both in the candle’s rising or falling color. The body is CandleStickMark.BodyWidthRatio of slot wide along X and of a unit deep along Z; pass the spacing of neighboring candles as slot when they are not one unit apart, such as seconds between days on a date axis. Swift Charts 3D has no candlestick, so this is a Chart Guru extension.

Parameters

NameType
markChartGuru.CandleStickMark
zSystem.Single
slotSystem.Single

Returns

ChartGuru.IChartMark[]