ChartComponent
[AddComponentMenu("ChartGuru/Chart")][ExecuteAlways]public class ChartComponent : MonoBehaviour, IChartHostHosts a Chart Guru chart on a GameObject for component-driven authoring and runtime updates. Use ChartGuru.ChartGraphic when the chart should render inside a uGUI Canvas.
Fields
Section titled “Fields”
chartType
Section titled “chartType”[Header("Chart Settings")][SerializeField]protected ChartType chartTypeNo description is available for this member.
Returns
ChartGuru.ChartType — No return description is available.
[SerializeField]protected ChartTheme themeNo description is available for this member.
Returns
ChartGuru.ChartTheme — No return description is available.
tinyPadding
Section titled “tinyPadding”[Header("Compact Chart Options")][Tooltip("Padding inside the compact chart in pixels.")][SerializeField][Range(0, 20)]protected float tinyPaddingNo description is available for this member.
Returns
System.Single — No return description is available.
tinyLineWidth
Section titled “tinyLineWidth”[Tooltip("Stroke width for the sparkline or trend line.")][SerializeField][Range(0.1, 10)]protected float tinyLineWidthNo description is available for this member.
Returns
System.Single — No return description is available.
showMinMax
Section titled “showMinMax”[Tooltip("Show markers at the minimum and maximum data values.")][SerializeField]protected bool showMinMaxNo description is available for this member.
Returns
System.Boolean — No return description is available.
showLastValue
Section titled “showLastValue”[Tooltip("Highlight the most recent (last) data point.")][SerializeField]protected bool showLastValueNo description is available for this member.
Returns
System.Boolean — No return description is available.
stackingMethod
Section titled “stackingMethod”[Header("Mark Style")][Tooltip("Stacking method for multi-series bar and area charts.")][SerializeField]protected MarkStackingMethod stackingMethodNo description is available for this member.
Returns
ChartGuru.MarkStackingMethod — No return description is available.
cornerRadius
Section titled “cornerRadius”[Tooltip("Corner radius for bar and sector marks.")][SerializeField][Range(0, 50)]protected float cornerRadiusNo description is available for this member.
Returns
System.Single — No return description is available.
interpolation
Section titled “interpolation”[Tooltip("Line interpolation for line and area charts.")][SerializeField]protected InterpolationMethod interpolationNo description is available for this member.
Returns
ChartGuru.InterpolationMethod — No return description is available.
lineWidth
Section titled “lineWidth”[Tooltip("Line width for line and area charts.")][SerializeField][Range(0.1, 20)]protected float lineWidthNo description is available for this member.
Returns
System.Single — No return description is available.
showSymbols
Section titled “showSymbols”[Tooltip("Show point symbols on line charts.")][SerializeField]protected bool showSymbolsNo description is available for this member.
Returns
System.Boolean — No return description is available.
symbolSize
Section titled “symbolSize”[Tooltip("Symbol size for point-based charts.")][SerializeField][Range(1, 50)]protected float symbolSizeNo description is available for this member.
Returns
System.Single — No return description is available.
symbol
Section titled “symbol”[Tooltip("Symbol shape for point-based charts.")][SerializeField]protected SymbolShape symbolNo description is available for this member.
Returns
ChartGuru.SymbolShape — No return description is available.
opacity
Section titled “opacity”[Tooltip("Opacity applied to supported marks.")][SerializeField][Range(0, 1)]protected float opacityNo description is available for this member.
Returns
System.Single — No return description is available.
innerRadius
Section titled “innerRadius”[Tooltip("Inner radius ratio for donut charts.")][SerializeField][Range(0, 0.9)]protected float innerRadiusNo description is available for this member.
Returns
System.Single — No return description is available.
angularInset
Section titled “angularInset”[Tooltip("Angular inset between pie/donut slices in degrees.")][SerializeField][Range(0, 10)]protected float angularInsetNo description is available for this member.
Returns
System.Single — No return description is available.
[Header("Axis")][SerializeField]protected AxisConfig xAxisNo description is available for this member.
Returns
ChartGuru.AxisConfig — No return description is available.
[SerializeField]protected AxisConfig yAxisNo description is available for this member.
Returns
ChartGuru.AxisConfig — No return description is available.
[Tooltip("Z axis (depth) for 3D charts. Used by Chart3DComponent and ignored by pure 2D rendering.")][SerializeField]protected AxisConfig zAxisNo description is available for this member.
Returns
ChartGuru.AxisConfig — No return description is available.
legendPosition
Section titled “legendPosition”[Header("Legend")][SerializeField]protected LegendPosition legendPositionNo description is available for this member.
Returns
ChartGuru.LegendPosition — No return description is available.
legendAlignment
Section titled “legendAlignment”[SerializeField]protected LegendAlignment legendAlignmentNo description is available for this member.
Returns
ChartGuru.LegendAlignment — No return description is available.
_chartTitleText
Section titled “_chartTitleText”[Header("Chart title")][SerializeField]protected string _chartTitleTextNo description is available for this member.
Returns
System.String — No return description is available.
_chartSubtitleText
Section titled “_chartSubtitleText”[SerializeField]protected string _chartSubtitleTextNo description is available for this member.
Returns
System.String — No return description is available.
_chartTitlePosition
Section titled “_chartTitlePosition”[SerializeField]protected ChartTitlePosition _chartTitlePositionNo description is available for this member.
Returns
ChartGuru.ChartTitlePosition — No return description is available.
showAxisLabels
Section titled “showAxisLabels”[Header("Text / Labels")][Tooltip("Show axis tick labels.")][SerializeField]protected bool showAxisLabelsNo description is available for this member.
Returns
System.Boolean — No return description is available.
showAxisTitles
Section titled “showAxisTitles”[Tooltip("Show axis title labels.")][SerializeField]protected bool showAxisTitlesNo description is available for this member.
Returns
System.Boolean — No return description is available.
showDataLabels
Section titled “showDataLabels”[Tooltip("Show data value labels on marks.")][SerializeField]protected bool showDataLabelsNo description is available for this member.
Returns
System.Boolean — No return description is available.
dataLabelFormat
Section titled “dataLabelFormat”[Tooltip("Format string for data labels, e.g. {value}.")][SerializeField]protected string dataLabelFormatNo description is available for this member.
Returns
System.String — No return description is available.
pieLabelMode
Section titled “pieLabelMode”[Tooltip("Label positioning mode for pie/donut charts.")][SerializeField]protected PieLabelMode pieLabelModeNo description is available for this member.
Returns
ChartGuru.PieLabelMode — No return description is available.
animation
Section titled “animation”[Tooltip("Animation used for data changes and entry animation. Leave disabled for instant updates.")][SerializeField]protected AnimationField animationNo description is available for this member.
Returns
ChartGuru.AnimationField — No return description is available.
timing
Section titled “timing”[Header("Timing")][Tooltip("Clock source and update timing used by chart animations and edit-mode previews.")][SerializeField]protected FrameTimingSettings timingNo description is available for this member.
Returns
ImpossibleRobert.Common.Timing.FrameTimingSettings — No return description is available.
_chart
Section titled “_chart”[NonSerialized]protected Chart _chartRuntime chart model — never serialized on the component so it
cannot collide with Chart3DComponent’s persisted chart field
(formerly named _chart in YAML).
Returns
ChartGuru.Chart — No return description is available.
_renderer
Section titled “_renderer”protected ChartRenderer _rendererNo description is available for this member.
Returns
ChartGuru.ChartRenderer — No return description is available.
_proxy
Section titled “_proxy”protected ChartProxy _proxyNo description is available for this member.
Returns
ChartGuru.ChartProxy — No return description is available.
_initialized
Section titled “_initialized”protected bool _initializedNo description is available for this member.
Returns
System.Boolean — No return description is available.
Events
Section titled “Events”
OnDataPointClicked
Section titled “OnDataPointClicked”public event Action<int, DataPoint> OnDataPointClickedNo description is available for this member.
Returns
System.Action{System.Int32,ChartGuru.DataPoint} — No return description is available.
OnDataPointHovered
Section titled “OnDataPointHovered”public event Action<int, DataPoint> OnDataPointHoveredNo description is available for this member.
Returns
System.Action{System.Int32,ChartGuru.DataPoint} — No return description is available.
OnAnimationComplete
Section titled “OnAnimationComplete”public event Action OnAnimationCompleteNo description is available for this member.
Returns
System.Action — No return description is available.
Properties
Section titled “Properties”
public Chart Chart { get; }The bound ChartGuru.IChartHost.Chart model, if any.
Returns
ChartGuru.Chart — No return description is available.
Renderer
Section titled “Renderer”public ChartRenderer Renderer { get; }No description is available for this member.
Returns
ChartGuru.ChartRenderer — No return description is available.
public ChartProxy Proxy { get; }No description is available for this member.
Returns
ChartGuru.ChartProxy — No return description is available.
IsTinyChart
Section titled “IsTinyChart”public bool IsTinyChart { get; }No description is available for this member.
Returns
System.Boolean — No return description is available.
StackingMethod
Section titled “StackingMethod”public MarkStackingMethod StackingMethod { get; set; }No description is available for this member.
Returns
ChartGuru.MarkStackingMethod — No return description is available.
CornerRadius
Section titled “CornerRadius”public float CornerRadius { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
Interpolation
Section titled “Interpolation”public InterpolationMethod Interpolation { get; set; }No description is available for this member.
Returns
ChartGuru.InterpolationMethod — No return description is available.
LineWidth
Section titled “LineWidth”public float LineWidth { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
ShowSymbols
Section titled “ShowSymbols”public bool ShowSymbols { get; set; }No description is available for this member.
Returns
System.Boolean — No return description is available.
SymbolSize
Section titled “SymbolSize”public float SymbolSize { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
Symbol
Section titled “Symbol”public SymbolShape Symbol { get; set; }No description is available for this member.
Returns
ChartGuru.SymbolShape — No return description is available.
Opacity
Section titled “Opacity”public float Opacity { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
InnerRadius
Section titled “InnerRadius”public float InnerRadius { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
AngularInset
Section titled “AngularInset”public float AngularInset { get; set; }No description is available for this member.
Returns
System.Single — No return description is available.
ChartType
Section titled “ChartType”public ChartType ChartType { get; set; }Available chart types. Aligned with Swift Charts mark-based approach. Includes compact/tiny chart variants for inline display.
Returns
ChartGuru.ChartType — No return description is available.
public ChartTheme Theme { get; set; }No description is available for this member.
Returns
ChartGuru.ChartTheme — No return description is available.
public Vector2 Size { get; set; }No description is available for this member.
Returns
UnityEngine.Vector2 — No return description is available.
UseBackgroundOverride
Section titled “UseBackgroundOverride”public bool UseBackgroundOverride { get; set; }Enables or disables the background override (overrides theme).
Returns
System.Boolean — No return description is available.
BackgroundOverrideMode
Section titled “BackgroundOverrideMode”public ChartBackgroundMode BackgroundOverrideMode { get; set; }Background rendering mode used when ChartGuru.ChartComponent.UseBackgroundOverride is true.
Returns
ChartGuru.ChartBackgroundMode — No return description is available.
BackgroundOverrideColor
Section titled “BackgroundOverrideColor”public Color BackgroundOverrideColor { get; set; }Solid colour used when ChartGuru.ChartComponent.BackgroundOverrideMode is SolidColor.
Returns
UnityEngine.Color — No return description is available.
BackgroundOverrideGradient
Section titled “BackgroundOverrideGradient”public LinearGradientStyle BackgroundOverrideGradient { get; set; }Linear gradient used when ChartGuru.ChartComponent.BackgroundOverrideMode is LinearGradient.
Returns
ChartGuru.LinearGradientStyle — No return description is available.
BackgroundOverrideFourCorner
Section titled “BackgroundOverrideFourCorner”public FourCornerGradient BackgroundOverrideFourCorner { get; set; }Four-corner gradient used when ChartGuru.ChartComponent.BackgroundOverrideMode is FourCornerGradient.
Returns
ChartGuru.FourCornerGradient — No return description is available.
Methods
Section titled “Methods”
IsTinyChartType(ChartType)
Section titled “IsTinyChartType(ChartType)”protected static bool IsTinyChartType(ChartType type)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
type |
ChartGuru.ChartType |
Returns
System.Boolean — No return description is available.
OnEnable()
Section titled “OnEnable()”protected virtual void OnEnable()No description is available for this member.
OnDisable()
Section titled “OnDisable()”protected virtual void OnDisable()No description is available for this member.
Initialize()
Section titled “Initialize()”protected virtual void Initialize()No description is available for this member.
BuildRuntimeChart()
Section titled “BuildRuntimeChart()”protected virtual Chart BuildRuntimeChart()Creates the runtime ChartGuru.ChartComponent.Chart from serialized fields.
Chart3DComponent overrides this to build 3D charts and
restore serialized chart models without duplicating _chart.
Returns
ChartGuru.Chart — No return description is available.
ApplyAxisConfig(AxisBuilder, AxisConfig)
Section titled “ApplyAxisConfig(AxisBuilder, AxisConfig)”protected void ApplyAxisConfig(AxisBuilder builder, AxisConfig config)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
builder |
ChartGuru.AxisBuilder | |
config |
ChartGuru.AxisConfig | |
ApplyTextAndLabelConfig(Chart)
Section titled “ApplyTextAndLabelConfig(Chart)”protected void ApplyTextAndLabelConfig(Chart chart)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
chart |
ChartGuru.Chart | |
CreateSerializedAuthoringStyle()
Section titled “CreateSerializedAuthoringStyle()”protected ChartAuthoringStyleOptions CreateSerializedAuthoringStyle()No description is available for this member.
Returns
ChartGuru.ChartAuthoringStyleOptions — No return description is available.
ApplyMarkStyleConfig(Chart)
Section titled “ApplyMarkStyleConfig(Chart)”protected virtual void ApplyMarkStyleConfig(Chart chart)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
chart |
ChartGuru.Chart | |
RefreshMarkStyle()
Section titled “RefreshMarkStyle()”protected virtual void RefreshMarkStyle()No description is available for this member.
Cleanup()
Section titled “Cleanup()”protected virtual void Cleanup()No description is available for this member.
RebuildChart()
Section titled “RebuildChart()”protected virtual void RebuildChart()No description is available for this member.
SetDirty()
Section titled “SetDirty()”public virtual void SetDirty()ChartGuru.IChartHost.SetDirty — requests a full rebuild on the next frame.
SetData(IEnumerable, Func<T, float>, Func<T, float>)
Section titled “SetData(IEnumerable, Func<T, float>, Func<T, float>)”public void SetData<T>(IEnumerable<T> data, Func<T, float> xSelector, Func<T, float> ySelector)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
data |
System.Collections.Generic.IEnumerable{{T}} | |
xSelector |
System.Func{{T},System.Single} | |
ySelector |
System.Func{{T},System.Single} | |
SetData(float[])
Section titled “SetData(float[])”public void SetData(float[] values)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
values |
System.Single[] | |
SetData(float[], float[])
Section titled “SetData(float[], float[])”public void SetData(float[] xValues, float[] yValues)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
xValues |
System.Single[] | |
yValues |
System.Single[] | |
AddDataPoint(float, float)
Section titled “AddDataPoint(float, float)”public void AddDataPoint(float x, float y)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
x |
System.Single | |
y |
System.Single | |
ClearData()
Section titled “ClearData()”public void ClearData()No description is available for this member.
SelectAtPosition(Vector2)
Section titled “SelectAtPosition(Vector2)”public bool SelectAtPosition(Vector2 localPosition)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
localPosition |
UnityEngine.Vector2 |
Returns
System.Boolean — No return description is available.
SelectAtX(float)
Section titled “SelectAtX(float)”public bool SelectAtX(float localX)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
localX |
System.Single |
Returns
System.Boolean — No return description is available.
SelectAngleAtPosition(Vector2)
Section titled “SelectAngleAtPosition(Vector2)”public bool SelectAngleAtPosition(Vector2 localPosition)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
localPosition |
UnityEngine.Vector2 |
Returns
System.Boolean — No return description is available.
SelectXRange(float, float)
Section titled “SelectXRange(float, float)”public ClosedRange<float>? SelectXRange(float startLocalX, float endLocalX)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
startLocalX |
System.Single | |
endLocalX |
System.Single |
Returns
System.Nullable{ChartGuru.ClosedRange{System.Single}} — No return description is available.
SelectYRange(float, float)
Section titled “SelectYRange(float, float)”public ClosedRange<float>? SelectYRange(float startLocalY, float endLocalY)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
startLocalY |
System.Single | |
endLocalY |
System.Single |
Returns
System.Nullable{ChartGuru.ClosedRange{System.Single}} — No return description is available.
ScrollXBy(float)
Section titled “ScrollXBy(float)”public void ScrollXBy(float delta)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
delta |
System.Single | |
ScrollYBy(float)
Section titled “ScrollYBy(float)”public void ScrollYBy(float delta)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
delta |
System.Single | |
ScrollToX(float)
Section titled “ScrollToX(float)”public void ScrollToX(float value)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
value |
System.Single | |
ScrollToY(float)
Section titled “ScrollToY(float)”public void ScrollToY(float value)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
value |
System.Single | |
ZoomX(float, float)
Section titled “ZoomX(float, float)”public void ZoomX(float zoomFactor, float anchorLocalX)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
zoomFactor |
System.Single | |
anchorLocalX |
System.Single | |
ZoomY(float, float)
Section titled “ZoomY(float, float)”public void ZoomY(float zoomFactor, float anchorLocalY)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
zoomFactor |
System.Single | |
anchorLocalY |
System.Single | |
Zoom(float, float, Vector2)
Section titled “Zoom(float, float, Vector2)”public void Zoom(float zoomFactorX, float zoomFactorY, Vector2 anchorLocalPosition)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
zoomFactorX |
System.Single | |
zoomFactorY |
System.Single | |
anchorLocalPosition |
UnityEngine.Vector2 | |
PanViewportByPixels(Vector2)
Section titled “PanViewportByPixels(Vector2)”public void PanViewportByPixels(Vector2 pixelDelta)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
pixelDelta |
UnityEngine.Vector2 | |
ResetViewport()
Section titled “ResetViewport()”public void ResetViewport()No description is available for this member.
ClearSelectionRanges()
Section titled “ClearSelectionRanges()”public void ClearSelectionRanges()No description is available for this member.
PlayEntryAnimation()
Section titled “PlayEntryAnimation()”public void PlayEntryAnimation()Replays the entry Animation (zero -> current values) using the component’s configured animation. No-op if the animation is disabled.
MorphTo(ChartType, Animation?)
Section titled “MorphTo(ChartType, Animation?)”public void MorphTo(ChartType targetType, Animation? morphAnimation = null)Morphs the chart to a new type. Driven end-to-end by the morpher: the request
is handed to ChartGuru.Chart.MorphTo(ChartGuru.ChartType%2cChartGuru.MorphOptions), and the
renderer kicks off the visual transition on its next tick.
Parameters
| Name | Type | Description |
|---|---|---|
targetType |
ChartGuru.ChartType | |
morphAnimation |
System.Nullable{ChartGuru.Animation} | |
ConfigureXAxis(Action)
Section titled “ConfigureXAxis(Action)”public ChartComponent ConfigureXAxis(Action<AxisBuilder> configure)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
configure |
System.Action{ChartGuru.AxisBuilder} |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureYAxis(Action)
Section titled “ConfigureYAxis(Action)”public ChartComponent ConfigureYAxis(Action<AxisBuilder> configure)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
configure |
System.Action{ChartGuru.AxisBuilder} |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureZAxis(Action)
Section titled “ConfigureZAxis(Action)”public ChartComponent ConfigureZAxis(Action<AxisBuilder> configure)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
configure |
System.Action{ChartGuru.AxisBuilder} |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureLegend(LegendPosition)
Section titled “ConfigureLegend(LegendPosition)”public ChartComponent ConfigureLegend(LegendPosition position)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
position |
ChartGuru.LegendPosition |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureLegend(LegendPosition, LegendAlignment)
Section titled “ConfigureLegend(LegendPosition, LegendAlignment)”public ChartComponent ConfigureLegend(LegendPosition position, LegendAlignment alignment)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
position |
ChartGuru.LegendPosition | |
alignment |
ChartGuru.LegendAlignment |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureAnimation(Animation?)
Section titled “ConfigureAnimation(Animation?)”public ChartComponent ConfigureAnimation(Animation? newAnimation)Configures the animation used for data changes and entry animation. Pass
null for instant (non-animated) updates.
Parameters
| Name | Type | Description |
|---|---|---|
newAnimation |
System.Nullable{ChartGuru.Animation} |
Returns
ChartGuru.ChartComponent — No return description is available.
ConfigureCompactChart(float, float)
Section titled “ConfigureCompactChart(float, float)”public ChartComponent ConfigureCompactChart(float padding = 2, float lineWidth = 1.5)Configure compact chart settings. Use ChartType property to set the compact type (Sparkline, Trend, MiniBar, MiniPie, MiniDonut, Indicator).
Parameters
| Name | Type | Description |
|---|---|---|
padding |
System.Single | |
lineWidth |
System.Single |
Returns
ChartGuru.ChartComponent — No return description is available.
RenderToTexture(int, int)
Section titled “RenderToTexture(int, int)”public RenderTexture RenderToTexture(int width, int height)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
width |
System.Int32 | |
height |
System.Int32 |
Returns
UnityEngine.RenderTexture — No return description is available.
RenderToTexture2D(int, int)
Section titled “RenderToTexture2D(int, int)”public Texture2D RenderToTexture2D(int width, int height)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
width |
System.Int32 | |
height |
System.Int32 |
Returns
UnityEngine.Texture2D — No return description is available.