Skip to content

Chart3DBuilder

ClassChartGuruChartGuru.3D
public sealed class Chart3DBuilder

Mirror of ChartBuilder for 3D charts. Owns its own Chart instance (with ChartDimension.ThreeD) and exposes Swift-Charts-3D fluent modifiers such as chartZAxis, chartZScale, chart3DPose, chart3DCameraProjection, and animation.

public Chart3DBuilder()

public Chart3DBuilder Add(IChartMark mark)

Add a single renderable 3D mark.

Parameters

NameType
markChartGuru.IChartMark

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Add(IEnumerable<IChartMark> marks)

Adds the marks in enumeration order as Chart3DBuilder.Add(IChartMark) does for each: nulls are skipped and a mark that does not implement IChart3DMark throws an ArgumentException.

Parameters

NameType
marksSystem.Collections.Generic.IEnumerable{ChartGuru.IChartMark}

Returns

ChartGuru.Chart3DBuilder

AddHistogramBars(IEnumerable, Func<T, float>, NumberBins, Func<List, float>, Color?, string, float)

Section titled “AddHistogramBars(IEnumerable, Func<T, float>, NumberBins, Func<List, float>, Color?, string, float)”
public Chart3DBuilder AddHistogramBars<T>(IEnumerable<T> data, Func<T, float> value, NumberBins<float> bins, Func<List<T>, float> aggregate = null, Color? color = null, string seriesKey = "Histogram", float z = 0)

Histogram: buckets data by value into bins and adds a Bar3DMark per bin at its middle and depth z, with the bin’s count or aggregate of its items, as ChartGuru.ChartBuilder.AddHistogramBars<T1>(System.Collections.Generic.IEnumerable<<>>, System.Func<<>, float>, ChartGuru.NumberBins<float>, System.Func<System.Collections.Generic.List<<>>, float>, System.Nullable<UnityEngine.Color>, string) does. Each bar spans its bin, so neighbors touch like the bins they count, and the X domain runs from the first bin edge to the last unless the chart sets one. A Chart Guru extension: Swift Charts 3D has no bar mark.

Parameters

NameType
dataSystem.Collections.Generic.IEnumerable{{T}}
valueSystem.Func{{T},System.Single}
binsChartGuru.NumberBins{System.Single}
aggregateSystem.Func{System.Collections.Generic.List{{T}},System.Single}
colorSystem.Nullable{UnityEngine.Color}
seriesKeySystem.String
zSystem.Single

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartType(ChartType type)

Explicit chart type override (e.g. force ChartType.Scatter3D).

Parameters

NameType
typeChartGuru.ChartType

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Theme(ChartTheme theme)

Theme for the palette, typography, axis, grid and text colors and, through its 3D appearance, the 3D look. Null uses the default theme.

Parameters

NameType
themeChartGuru.ChartTheme

Returns

ChartGuru.Chart3DBuilder

ChartForegroundStyleScale(Dictionary<string, Color>)

Section titled “ChartForegroundStyleScale(Dictionary<string, Color>)”
public Chart3DBuilder ChartForegroundStyleScale(Dictionary<string, Color> scale)

Maps style keys to colors, so marks with a matching ForegroundStyleKey and the legend draw them in those colors; null clears the mapping. Swift Charts equivalent: .chartForegroundStyleScale([“A”: .red]), which native Chart3D ignores.

Parameters

NameType
scaleSystem.Collections.Generic.Dictionary{System.String,UnityEngine.Color}

Returns

ChartGuru.Chart3DBuilder

ChartSymbolScale(Dictionary<string, Symbol3D>)

Section titled “ChartSymbolScale(Dictionary<string, Symbol3D>)”
public Chart3DBuilder ChartSymbolScale(Dictionary<string, Symbol3D> scale)

Maps symbol keys to 3D symbols, so points whose PointMark3D.Symbol(PlottableValueRef) key matches draw as that symbol; null clears the mapping. Keys without an entry take spheres, cubes, cones and cylinders in the order they first appear. The chart keeps the mapping as its 2D symbol scale (circle, square, triangle and diamond for these four), which billboards and custom meshes cannot join: they draw as spheres there. Swift Charts equivalent: .chartSymbolScale([“Adelie”: .square]).

Parameters

NameType
scaleSystem.Collections.Generic.Dictionary{System.String,ChartGuru.Symbol3D}

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartForegroundStyleScale(ColorScale scale)

Colors marks whose style key is a number through scale, a continuous color scale such as ColorScale.Viridis(0f, 10f), which the legend shows; null returns them to the automatic scale over their own values. Swift Charts equivalent: .chartForegroundStyleScale(domain:range:) for numeric values.

Parameters

NameType
scaleChartGuru.ColorScale

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ColorScalePresetIndex(int presetIndex)

The built-in color scale that numeric style keys use without an explicit scale, by preset index; -1 uses the default.

Parameters

NameType
presetIndexSystem.Int32

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartXAxis(Action<AxisBuilder> configure)

Swift Charts equivalent: .chartXAxis { … }.

Parameters

NameType
configureSystem.Action{ChartGuru.AxisBuilder}

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartYAxis(Action<AxisBuilder> configure)

Swift Charts equivalent: .chartYAxis { … }.

Parameters

NameType
configureSystem.Action{ChartGuru.AxisBuilder}

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZAxis(Action<AxisBuilder> configure)

Swift Charts 3D equivalent: .chartZAxis { … }.

Parameters

NameType
configureSystem.Action{ChartGuru.AxisBuilder}

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartXScale(ScaleType type)

Swift Charts equivalent: .chartXScale(type:).

Parameters

NameType
typeChartGuru.ScaleType

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartXScale(ScaleType type, double scaleParameter)

Configures a parameterized X scale such as power or symmetric log.

Parameters

NameType
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartXScale(float domainMin, float domainMax, ScaleType? type = null)

Swift Charts equivalent: .chartXScale(domain:type:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

ChartXScale(float, float, ScaleType, double)

Section titled “ChartXScale(float, float, ScaleType, double)”
public Chart3DBuilder ChartXScale(float domainMin, float domainMax, ScaleType type, double scaleParameter)

Configures an X domain and parameterized scale type.

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartYScale(ScaleType type)

Swift Charts equivalent: .chartYScale(type:).

Parameters

NameType
typeChartGuru.ScaleType

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartYScale(ScaleType type, double scaleParameter)

Configures a parameterized Y scale such as power or symmetric log.

Parameters

NameType
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartYScale(float domainMin, float domainMax, ScaleType? type = null)

Swift Charts equivalent: .chartYScale(domain:type:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

ChartYScale(float, float, ScaleType, double)

Section titled “ChartYScale(float, float, ScaleType, double)”
public Chart3DBuilder ChartYScale(float domainMin, float domainMax, ScaleType type, double scaleParameter)

Configures a Y domain and parameterized scale type.

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZScale(ScaleType type)

Swift Charts equivalent: .chartZScale(type:).

Parameters

NameType
typeChartGuru.ScaleType

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZScale(ScaleType type, double scaleParameter)

Configures a parameterized Z scale such as power or symmetric log.

Parameters

NameType
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZScale(float domainMin, float domainMax, ScaleType? type = null)

Swift Charts equivalent: .chartZScale(domain:type:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

ChartZScale(float, float, ScaleType, double)

Section titled “ChartZScale(float, float, ScaleType, double)”
public Chart3DBuilder ChartZScale(float domainMin, float domainMax, ScaleType type, double scaleParameter)

Configures a Z domain and parameterized scale type.

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
typeChartGuru.ScaleType
scaleParameterSystem.Double

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartXScaleDomain(float domainMin, float domainMax)

Swift Charts equivalent: .ChartXScale(domain:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartYScaleDomain(float domainMin, float domainMax)

Swift Charts equivalent: .ChartYScale(domain:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZScaleDomain(float domainMin, float domainMax)

Swift Charts 3D equivalent: .chartZScale(domain:).

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single

Returns

ChartGuru.Chart3DBuilder

ChartXScaleRange(float, float, ScaleType?)

Section titled “ChartXScaleRange(float, float, ScaleType?)”
public Chart3DBuilder ChartXScaleRange(float rangeMin, float rangeMax, ScaleType? type = null)

Swift Charts equivalent: .ChartXScale(range:).

Parameters

NameType
rangeMinSystem.Single
rangeMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

ChartYScaleRange(float, float, ScaleType?)

Section titled “ChartYScaleRange(float, float, ScaleType?)”
public Chart3DBuilder ChartYScaleRange(float rangeMin, float rangeMax, ScaleType? type = null)

Swift Charts equivalent: .ChartYScale(range:).

Parameters

NameType
rangeMinSystem.Single
rangeMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

ChartZScaleRange(float, float, ScaleType?)

Section titled “ChartZScaleRange(float, float, ScaleType?)”
public Chart3DBuilder ChartZScaleRange(float rangeMin, float rangeMax, ScaleType? type = null)

Swift Charts 3D equivalent: .chartZScale(range:).

Parameters

NameType
rangeMinSystem.Single
rangeMaxSystem.Single
typeSystem.Nullable{ChartGuru.ScaleType}

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Chart3DPose(Chart3DPose pose)

Set the camera pose. Swift Charts equivalent: .Chart3DPose(_:).

Parameters

NameType
poseChartGuru.Chart3DPose

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Chart3DPose(float azimuthDegrees, float inclinationDegrees)

Set the camera pose from raw azimuth/inclination angles in degrees.

Parameters

NameType
azimuthDegreesSystem.Single
inclinationDegreesSystem.Single

Returns

ChartGuru.Chart3DBuilder

Chart3DCameraProjection(Chart3DCameraProjection)

Section titled “Chart3DCameraProjection(Chart3DCameraProjection)”
public Chart3DBuilder Chart3DCameraProjection(Chart3DCameraProjection projection)

Set the camera projection. Swift Charts equivalent: .Chart3DCameraProjection(_:).

Parameters

NameType
projectionChartGuru.Chart3DCameraProjection

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder SurfacePreset(Chart3DSurfacePreset preset)

Chooses the base surface material while preserving per-mark roughness and metalness overrides.

Parameters

NameType
presetChartGuru.Chart3DSurfacePreset

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Animation(Animation animation)

Sets the animation the built chart plays when its values change, which lifts and entry replays also use when given none; without one, changes show at once.

Parameters

NameType
animationChartGuru.Animation

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Stacking(MarkStackingMethod method)

Sets the stacking of every Bar3DMark and StackedArea3DMark in the chart when Chart3DBuilder.Build() runs, replacing the method each mark set; other marks are unaffected.

Parameters

NameType
methodChartGuru.MarkStackingMethod

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Stacked()

Stacks every bar and stacked area from zero when the chart is built; shortcut for Stacking(MarkStackingMethod.Standard).

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Grouped()

Builds every bar and stacked area unstacked, each standing from zero at its own X and Z; shortcut for Stacking(MarkStackingMethod.Unstacked).

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Normalized()

Stacks every bar and stacked area as shares of the total at its position when the chart is built, so stacks fill 0 to 1; shortcut for Stacking(MarkStackingMethod.Normalized).

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder Centered()

Stacks every bar and stacked area centered on zero when the chart is built, like a streamgraph; shortcut for Stacking(MarkStackingMethod.Center).

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartTitle(string title)

Sets the title 3D hosts draw outside the plot, at the chart’s title position (top center by default) in the theme’s title style; null or empty adds none.

Parameters

NameType
titleSystem.String

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartSubtitle(string subtitle)

Sets the subtitle 3D hosts draw under the title in the theme’s subtitle style; null or empty adds none.

Parameters

NameType
subtitleSystem.String

Returns

ChartGuru.Chart3DBuilder

public Chart3DBuilder ChartZSelection(Action<float?> handler)

Swift Charts equivalent: .ChartZSelection(…).

Parameters

NameType
handlerSystem.Action{System.Nullable{System.Single}}

Returns

ChartGuru.Chart3DBuilder

public Chart Build()

Build and return the configured Chart. The caller typically passes it to a Chart3DComponent in the scene or to the editor preview window.

Returns

ChartGuru.Chart