Chart3DImage
public sealed class Chart3DImage : MaskableGraphic, IChartHostA 3D chart on a Canvas. 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, and draws it through its own private view, which renders only when something it shows changed. Pointer events reach it like any Graphic: drags orbit the pose, scroll and pinch zoom the view, and hover, taps and tooltips use the same pointer path as every chart host.
Methods
Section titled “Methods”
SetChart(Chart)
Section titled “SetChart(Chart)”public void SetChart(Chart chart)Shows a chart built in code instead of the image’s content or source until Chart3DImage.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
| Name | Type |
|---|---|
chart | ChartGuru.Chart |
ClearChart()
Section titled “ClearChart()”public void ClearChart()Returns from a chart set in code to the image’s content or source.
SetData(ChartDataFrame, bool)
Section titled “SetData(ChartDataFrame, bool)”public void SetData(ChartDataFrame data, bool shapeChanged = true)Shows data instead of the bound data of the image’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
| Name | Type |
|---|---|
data | ChartGuru.ChartDataFrame |
shapeChanged | System.Boolean |
ClearData()
Section titled “ClearData()”public void ClearData()Returns from data set in code to the bound data.
Rebuild()
Section titled “Rebuild()”public void Rebuild()Recompiles the image’s own chart from its definition and data now; a disabled image recompiles when enabled.
SetDirty()
Section titled “SetDirty()”public void SetDirty()Recompiles the image’s own chart on the next update.
ReplayEntryAnimation(Animation?)
Section titled “ReplayEntryAnimation(Animation?)”public void ReplayEntryAnimation(Animation? animation = null)Replays the entry animation of the image’s own chart, using the chart’s animation when none is given.
Parameters
| Name | Type |
|---|---|
animation | System.Nullable{ChartGuru.Animation} |
PlayLift(float, Animation?, Action)
Section titled “PlayLift(float, Animation?, Action)”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
| Name | Type |
|---|---|
lift | System.Single |
animation | System.Nullable{ChartGuru.Animation} |
completed | System.Action |
Invalidate()
Section titled “Invalidate()”public void Invalidate()Rebuilds and renders the view on its next update, for content that changed without telling the chart, such as a
stateful surface function; Chart3DImage.Refresh(float) renders at once.
Refresh(float)
Section titled “Refresh(float)”public void Refresh(float deltaTime = 0)Immediately renders current inputs, including stateful functions. Use deltaTime to advance a manually clocked view.
Parameters
| Name | Type |
|---|---|
deltaTime | System.Single |
OnPointerDown(PointerEventData)
Section titled “OnPointerDown(PointerEventData)”public void OnPointerDown(PointerEventData eventData)Starts a press: a tap when released in place, an orbit or pinch when it moves.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnPointerUp(PointerEventData)
Section titled “OnPointerUp(PointerEventData)”public void OnPointerUp(PointerEventData eventData)Ends a press, selecting the mark under a tap or finishing an orbit.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnPointerMove(PointerEventData)
Section titled “OnPointerMove(PointerEventData)”public void OnPointerMove(PointerEventData eventData)Tracks hover, which drives tooltips.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnPointerExit(PointerEventData)
Section titled “OnPointerExit(PointerEventData)”public void OnPointerExit(PointerEventData eventData)Clears the hover target when the pointer leaves the chart.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnInitializePotentialDrag(PointerEventData)
Section titled “OnInitializePotentialDrag(PointerEventData)”public void OnInitializePotentialDrag(PointerEventData eventData)Lets drags start at the chart’s own threshold, which tells taps from drags for every host alike.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnDrag(PointerEventData)
Section titled “OnDrag(PointerEventData)”public void OnDrag(PointerEventData eventData)Moves a pressed pointer, which orbits the chart or feeds its custom drag gesture.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
OnScroll(PointerEventData)
Section titled “OnScroll(PointerEventData)”public void OnScroll(PointerEventData eventData)Zooms the view, or feeds the chart’s magnification gesture.
Parameters
| Name | Type |
|---|---|
eventData | UnityEngine.EventSystems.PointerEventData |
ClearSelection()
Section titled “ClearSelection()”public void ClearSelection()Clears the selection on the chart being drawn.
Constructors
Section titled “Constructors”
Chart3DImage()
Section titled “Chart3DImage()”public Chart3DImage()Properties
Section titled “Properties”
ContentMode
Section titled “ContentMode”public Chart3DContentMode ContentMode { get; set; }Where this image gets its chart. Setting Chart3DContentMode.Own clears the source; Source mode
without a source draws nothing.
Returns
ChartGuru.Chart3DContentMode
Source
Section titled “Source”public Chart3DComponent Source { get; set; }The scene Chart 3D host this image mirrors in Source mode. Assigning a host switches the image to Source mode; null only clears the reference, so an image in Source mode then draws nothing. Either way a chart set from code is cleared.
Returns
ChartGuru.Chart3DComponent
Content
Section titled “Content”public ChartHostContent Content { get; }What this image hosts in Own mode: an inline definition or a chart asset, plus bound data.
Returns
ChartGuru.ChartHostContent
Definition
Section titled “Definition”public ChartDefinition Definition { get; }The definition of this image’s own chart, to read or edit. In Play Mode an image that uses a chart asset returns
its own copy, like Renderer.material, so runtime edits never change the asset. Call Chart3DImage.Rebuild()
after editing it.
Returns
ChartGuru.ChartDefinition
InlineDefinition
Section titled “InlineDefinition”public ChartDefinition InlineDefinition { get; set; }The definition stored with this image, used when no chart asset is assigned.
Returns
ChartGuru.ChartDefinition
DefinitionAsset
Section titled “DefinitionAsset”public ChartAsset DefinitionAsset { get; set; }Shared chart asset; assigning one replaces the inline definition until it is cleared.
Returns
ChartGuru.ChartAsset
DataAsset
Section titled “DataAsset”public ChartDataAsset DataAsset { get; set; }Shared data table bound to this image’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 image’s own chart.
Show a chart built in code with Chart3DImage.SetChart(Chart) and return with Chart3DImage.ClearChart().
Returns
ChartGuru.Chart
HasRuntimeChart
Section titled “HasRuntimeChart”public bool HasRuntimeChart { get; }True while a chart set from code replaces what the image shows.
Returns
System.Boolean
IsShowingPreviewData
Section titled “IsShowingPreviewData”public bool IsShowingPreviewData { get; }True while the image’s own chart shows generated preview data because nothing is bound and the definition has no rows.
Returns
System.Boolean
ViewSettings
Section titled “ViewSettings”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
Appearance
Section titled “Appearance”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
Projection
Section titled “Projection”public Chart3DCameraProjection Projection { get; set; }Returns
ChartGuru.Chart3DCameraProjection
AutoRotate
Section titled “AutoRotate”public bool AutoRotate { get; set; }Returns
System.Boolean
Texture
Section titled “Texture”public RenderTexture Texture { get; }Returns
UnityEngine.RenderTexture
HasError
Section titled “HasError”public bool HasError { get; }Returns
System.Boolean
mainTexture
Section titled “mainTexture”public override Texture mainTexture { get; }Returns
UnityEngine.Texture
public float Zoom { get; set; }Lens zoom of this view, changed by scroll and pinch; 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
TooltipState
Section titled “TooltipState”public ChartTooltipState TooltipState { get; }A snapshot of the tooltip’s visibility, pin state, hit, pointer position (in the image rect’s units from its bottom-left corner), retained content and change version; hovers and taps update it, and renders from a new camera move its hit with the mark.
Returns
ChartGuru.ChartTooltipState
Events
Section titled “Events”
OnDataPointClicked
Section titled “OnDataPointClicked”public event Action<int, DataPoint> OnDataPointClickedRaised when a data point is clicked or tapped.
Returns
System.Action{System.Int32,ChartGuru.DataPoint}
OnDataPointSelected
Section titled “OnDataPointSelected”public event Action<int, DataPoint> OnDataPointSelectedRaised when a data point becomes selected.
Returns
System.Action{System.Int32,ChartGuru.DataPoint}
OnDataPointHovered
Section titled “OnDataPointHovered”public event Action<int, DataPoint> OnDataPointHoveredRaised when the pointer moves onto a data point.
Returns
System.Action{System.Int32,ChartGuru.DataPoint}
OnSelectionCleared
Section titled “OnSelectionCleared”public event Action OnSelectionClearedRaised when the selection is cleared.
Returns
System.Action
OnTooltipChanged
Section titled “OnTooltipChanged”public event Action<ChartTooltipState> OnTooltipChangedRaised when the tooltip content or visibility changes.
Returns
System.Action{ChartGuru.ChartTooltipState}