Skip to content

Chart3DTexture

ClassChartGuruChartGuru.3D
public sealed class Chart3DTexture : MonoBehaviour, IChartHost

Renders a 3D chart into the RawImage on the same GameObject through its own private view, only when something it shows changed. It hosts its own chart like any chart host (an inline definition or a chart asset, plus bound data), or mirrors a scene Chart 3D host. Use it where the chart is a texture; Chart3DImage is the interactive Canvas chart.

public void SetChart(Chart chart)

Shows a chart built in code instead of the texture’s content or source until Chart3DTexture.ClearChart() is called. The chart is runtime state, is not saved and stays its caller’s. Like a mirrored source it is drawn as given, so several outputs can show one chart; whoever animates it runs its transitions.

Parameters

NameType
chartChartGuru.Chart
public void ClearChart()

Returns from a chart set in code to the texture’s content or source.

public void SetData(ChartDataFrame data, bool shapeChanged = true)

Shows data instead of the bound data of the texture’s own chart, mapped by the definition’s layers. The data is runtime state and is not saved; pass null to return to the bound data. Pass shapeChanged false when the data keeps the columns, row count and categories shown, so the chart’s values update in place.

Parameters

NameType
dataChartGuru.ChartDataFrame
shapeChangedSystem.Boolean
public void ClearData()

Returns from data set in code to the bound data.

public void Rebuild()

Recompiles the texture’s own chart from its definition and data now; a disabled texture recompiles when enabled.

public void SetDirty()

Recompiles the texture’s own chart on the next update.

public void ReplayEntryAnimation(Animation? animation = null)

Replays the entry animation of the texture’s own chart, using the chart’s animation when none is given.

Parameters

NameType
animationSystem.Nullable{ChartGuru.Animation}
public void PlayLift(float lift, Animation? animation = null, Action completed = null)

Plays the lift into 3D (toward 1) or the flattening into 2D (toward 0), as Chart3DComponent.PlayLift(float, Animation?, Action). The output’s own chart animates; a mirrored or code chart, drawn as given, takes the lift at once.

Parameters

NameType
liftSystem.Single
animationSystem.Nullable{ChartGuru.Animation}
completedSystem.Action
public void Invalidate()

Rebuilds and renders the texture on its next update, for content that changed without telling the chart, such as a stateful surface function; Chart3DTexture.Refresh(float) renders at once.

public void Refresh(float deltaTime = 0)

Immediately renders current inputs, including stateful functions. Use deltaTime to advance a manually clocked view.

Parameters

NameType
deltaTimeSystem.Single

public Chart3DTexture()

public Chart3DContentMode ContentMode { get; set; }

Where this texture gets its chart. Setting Chart3DContentMode.Own clears the source; Source mode without a source draws nothing.

Returns

ChartGuru.Chart3DContentMode

public Chart3DComponent Source { get; set; }

The scene Chart 3D host this texture mirrors in Source mode. Assigning a host switches the texture to Source mode; null only clears the reference, so a texture in Source mode then draws nothing. Either way a chart set from code is cleared.

Returns

ChartGuru.Chart3DComponent

public ChartHostContent Content { get; }

What this texture hosts in Own mode: an inline definition or a chart asset, plus bound data.

Returns

ChartGuru.ChartHostContent

public ChartDefinition Definition { get; }

The definition of this texture’s own chart, to read or edit. In Play Mode a texture that uses a chart asset returns its own copy, like Renderer.material, so runtime edits never change the asset. Call Chart3DTexture.Rebuild() after editing it.

Returns

ChartGuru.ChartDefinition

public ChartDefinition InlineDefinition { get; set; }

The definition stored with this texture, used when no chart asset is assigned.

Returns

ChartGuru.ChartDefinition

public ChartAsset DefinitionAsset { get; set; }

Shared chart asset; assigning one replaces the inline definition until it is cleared.

Returns

ChartGuru.ChartAsset

public ChartDataAsset DataAsset { get; set; }

Shared data table bound to this texture’s own chart.

Returns

ChartGuru.ChartDataAsset

public Chart Chart { get; }

The chart being drawn: a chart set from code, else the source’s chart in Source mode or this texture’s own chart. Show a chart built in code with Chart3DTexture.SetChart(Chart) and return with Chart3DTexture.ClearChart().

Returns

ChartGuru.Chart

public bool HasRuntimeChart { get; }

True while a chart set from code replaces what the texture shows.

Returns

System.Boolean

public bool IsShowingPreviewData { get; }

True while the texture’s own chart shows generated preview data because nothing is bound and the definition has no rows.

Returns

System.Boolean

public Chart3DViewSettings ViewSettings { get; }

Returns

ChartGuru.Chart3DViewSettings

public ChartTheme Theme { get; set; }

Optional theme for this output’s 3D look, axis, grid and text colors and background. Empty uses the chart’s theme; the chart’s own palette always colors the marks.

Returns

ChartGuru.ChartTheme

public Chart3DAppearanceOverride Appearance { get; set; }

Optional changes to the theme’s 3D look for this output only, such as another environment cubemap.

Returns

ChartGuru.Chart3DAppearanceOverride

public Chart3DPose Pose { get; set; }

Returns

ChartGuru.Chart3DPose

public Chart3DCameraProjection Projection { get; set; }

Returns

ChartGuru.Chart3DCameraProjection

public bool AutoRotate { get; set; }

Returns

System.Boolean

public RenderTexture Texture { get; }

Returns

UnityEngine.RenderTexture

public bool HasError { get; }

Returns

System.Boolean

public float Zoom { get; set; }

Lens zoom of this view; 1 is the framed size. Runtime only.

Returns

System.Single

public float Lift { get; set; }

How lifted the chart is drawn, as Chart3DComponent.Lift: 1 at full depth and the chart’s pose, 0 flat and facing the viewer, as its 2D chart. Setting it shows the new lift at once.

Returns

System.Single