ChartDataSourceBase
[ExecuteAlways]public abstract class ChartDataSourceBase : MonoBehaviour, IChartDataSourceAbstract base class for chart data sources. Shared functionality for populating ChartGraphic with data.
Fields
Section titled “Fields”
_targetChart
Section titled “_targetChart”[Header("Target Chart")][Tooltip("Target ChartGraphic (2D) to populate. If null, discovers charts on same GameObject or in child hierarchy.")][SerializeField]protected ChartGraphic _targetChartNo description is available for this member.
Returns
ChartGuru.ChartGraphic — No return description is available.
_targetChart3D
Section titled “_targetChart3D”[Tooltip("Optional target 3D host (e.g. Chart3DComponent). Typed as Component to avoid a hard dependency on the ChartGuru.3D add-on.")][SerializeField]protected Component _targetChart3DNo description is available for this member.
Returns
UnityEngine.Component — No return description is available.
Properties
Section titled “Properties”
TargetChart
Section titled “TargetChart”public ChartGraphic TargetChart { get; set; }The target ChartGraphic to populate. Setting this explicitly overrides hierarchy-based discovery.
Returns
ChartGuru.ChartGraphic — No return description is available.
TargetChart3D
Section titled “TargetChart3D”public Component TargetChart3D { get; set; }Optional 3D host (e.g. Chart3DComponent). Set this when the
data source lives alongside a 3D chart; the 2D and 3D targets can
coexist so the same data source populates both views when a scene
contains each.
Returns
UnityEngine.Component — No return description is available.
Methods
Section titled “Methods”
Awake()
Section titled “Awake()”protected virtual void Awake()No description is available for this member.
Start()
Section titled “Start()”protected virtual void Start()No description is available for this member.
OnEnable()
Section titled “OnEnable()”protected virtual void OnEnable()No description is available for this member.
OnValidate()
Section titled “OnValidate()”protected virtual void OnValidate()No description is available for this member.
ResolveTargetCharts()
Section titled “ResolveTargetCharts()”protected List<ChartGraphic> ResolveTargetCharts()Resolve target charts with the following priority:
- Explicit _targetChart (inspector-set) — just that one.
- ChartGraphic on same GameObject — just that one.
- All child ChartGraphic components that don’t have their own local ChartDataSourceBase.
Returns
System.Collections.Generic.List{ChartGuru.ChartGraphic} — No return description is available.
GetResolvedTargetCharts()
Section titled “GetResolvedTargetCharts()”public List<ChartGraphic> GetResolvedTargetCharts()Public accessor for ChartGuru.ChartDataSourceBase.ResolveTargetCharts so editor tooling
(Quick Sample buttons) can apply the sample’s chart type to the connected
chart when there is exactly one — without forcing the user to also assign
the inspector field.
Returns
System.Collections.Generic.List{ChartGuru.ChartGraphic} — No return description is available.
ResolveTarget3DHosts()
Section titled “ResolveTarget3DHosts()”protected List<IChart3DHost> ResolveTarget3DHosts()Resolve 3D host targets for this data source. Priority:
- Explicit
ChartGuru.ChartDataSourceBase._targetChart3D(must implement ChartGuru.IChart3DHost). - Any component on the same GameObject implementing ChartGuru.IChart3DHost.
- Any ChartGuru.IChart3DHost in children that doesn’t have its own local data source. Returns an empty list when no host is present — safe to call on pure 2D hierarchies.
Returns
System.Collections.Generic.List{ChartGuru.IChart3DHost} — No return description is available.
RaiseDataChanged()
Section titled “RaiseDataChanged()”protected void RaiseDataChanged()Fire ChartGuru.ChartDataSourceBase.DataChanged. Subclasses call this at the end of their ChartGuru.ChartDataSourceBase.ApplyData override.
BuildMarksForChartType(ChartType, ChartAuthoringStyleOptions)
Section titled “BuildMarksForChartType(ChartType, ChartAuthoringStyleOptions)”public virtual List<IChartMark> BuildMarksForChartType(ChartType chartType, ChartAuthoringStyleOptions style)Build marks shaped for the requested chartType and
style. Default implementation returns an empty
list; subclasses override to provide their data. The base class sets
ChartGuru.ChartDataSourceBase._activeStyleOverride for the duration of the call so
existing Get* helpers transparently pick up the UITK style.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartGuru.ChartType | |
style |
ChartGuru.ChartAuthoringStyleOptions |
Returns
System.Collections.Generic.List{ChartGuru.IChartMark} — No return description is available.
ApplyData()
Section titled “ApplyData()”public abstract void ApplyData()Apply the configured data to the target chart. Subclasses must implement this to provide their specific data.
ApplyDataImmediate()
Section titled “ApplyDataImmediate()”protected void ApplyDataImmediate()Apply data immediately without EditorApplication.delayCall. Used during streaming to ensure chart and text labels update synchronously.
GetCornerRadius()
Section titled “GetCornerRadius()”protected float GetCornerRadius()Get the corner radius from the target chart (or active style override).
Returns
System.Single — No return description is available.
GetStackingMethod()
Section titled “GetStackingMethod()”protected MarkStackingMethod GetStackingMethod()Get the stacking method from the target chart (or active style override).
Returns
ChartGuru.MarkStackingMethod — No return description is available.
GetInterpolation()
Section titled “GetInterpolation()”protected InterpolationMethod GetInterpolation()Get the interpolation method from the target chart (or active style override).
Returns
ChartGuru.InterpolationMethod — No return description is available.
GetLineWidth()
Section titled “GetLineWidth()”protected float GetLineWidth()Get the line width from the target chart (or active style override).
Returns
System.Single — No return description is available.
GetInnerRadius()
Section titled “GetInnerRadius()”protected float GetInnerRadius()Get the donut inner radius from the target chart (or active style override).
Returns
System.Single — No return description is available.
GetAngularInset()
Section titled “GetAngularInset()”protected float GetAngularInset()Get the sector pad angle from the target chart (or active style override).
Returns
System.Single — No return description is available.
GetBarLayout()
Section titled “GetBarLayout()”protected BarLayout? GetBarLayout()No description is available for this member.
Returns
System.Nullable{ChartGuru.BarLayout} — No return description is available.
GetBarWidth()
Section titled “GetBarWidth()”protected MarkDimension GetBarWidth()No description is available for this member.
Returns
ChartGuru.MarkDimension — No return description is available.
GetBarHeight()
Section titled “GetBarHeight()”protected MarkDimension GetBarHeight()No description is available for this member.
Returns
ChartGuru.MarkDimension — No return description is available.
GetForegroundStyleMode()
Section titled “GetForegroundStyleMode()”protected ForegroundStyleMode GetForegroundStyleMode()No description is available for this member.
Returns
ChartGuru.ForegroundStyleMode — No return description is available.
GetHeatMapCellPadding()
Section titled “GetHeatMapCellPadding()”protected float GetHeatMapCellPadding()No description is available for this member.
Returns
System.Single — No return description is available.
GetHeatMapCornerRadius()
Section titled “GetHeatMapCornerRadius()”protected float GetHeatMapCornerRadius()No description is available for this member.
Returns
System.Single — No return description is available.
CreateSingleSeriesMarks(ChartType, List, string, Color)
Section titled “CreateSingleSeriesMarks(ChartType, List, string, Color)”protected List<IChartMark> CreateSingleSeriesMarks(ChartType chartType, List<ChartDataEntry> dataPoints, string seriesName, Color primaryColor)Create marks for single-series data.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartGuru.ChartType | |
dataPoints |
System.Collections.Generic.List{ChartGuru.ChartDataEntry} | |
seriesName |
System.String | |
primaryColor |
UnityEngine.Color |
Returns
System.Collections.Generic.List{ChartGuru.IChartMark} — No return description is available.
CreateMultiSeriesMarks(ChartType, List)
Section titled “CreateMultiSeriesMarks(ChartType, List)”protected List<IChartMark> CreateMultiSeriesMarks(ChartType chartType, List<ChartDataSeries> dataSeries)Create marks for multi-series data.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartGuru.ChartType | |
dataSeries |
System.Collections.Generic.List{ChartGuru.ChartDataSeries} |
Returns
System.Collections.Generic.List{ChartGuru.IChartMark} — No return description is available.
ResolveXPosition(ChartDataEntry, int)
Section titled “ResolveXPosition(ChartDataEntry, int)”protected float ResolveXPosition(ChartDataEntry entry, int fallbackIndex)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
entry |
ChartGuru.ChartDataEntry | |
fallbackIndex |
System.Int32 |
Returns
System.Single — No return description is available.
ResolveXPosition(ChartDataEntry, int, bool)
Section titled “ResolveXPosition(ChartDataEntry, int, bool)”protected float ResolveXPosition(ChartDataEntry entry, int fallbackIndex, bool labelIsAmbiguous)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
entry |
ChartGuru.ChartDataEntry | |
fallbackIndex |
System.Int32 | |
labelIsAmbiguous |
System.Boolean |
Returns
System.Single — No return description is available.
CreateMark(ChartType, float, float, string, Color, LinearGradientStyle)
Section titled “CreateMark(ChartType, float, float, string, Color, LinearGradientStyle)”protected IChartMark CreateMark(ChartType chartType, float xValue, float value, string label, Color colorOverride, LinearGradientStyle gradientOverride)Create a chart mark of the appropriate type.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartGuru.ChartType | |
xValue |
System.Single | |
value |
System.Single | |
label |
System.String | |
colorOverride |
UnityEngine.Color | |
gradientOverride |
ChartGuru.LinearGradientStyle |
Returns
ChartGuru.IChartMark — No return description is available.
CreateMark(ChartType, float, float, string, Color, LinearGradientStyle, ChartDataEntry)
Section titled “CreateMark(ChartType, float, float, string, Color, LinearGradientStyle, ChartDataEntry)”protected IChartMark CreateMark(ChartType chartType, float xValue, float value, string label, Color colorOverride, LinearGradientStyle gradientOverride, ChartDataEntry entry)Overload that threads the originating ChartGuru.ChartDataEntry down to
ChartGuru.ChartMarkFactory.CreateMark(ChartGuru.ChartType%2cSystem.Single%2cSystem.Single%2cSystem.String%2cUnityEngine.Color%2cChartGuru.LinearGradientStyle%2cChartGuru.ChartAuthoringStyleOptions%2cChartGuru.ChartDataEntry)
so OHLC-bearing entries can be turned into real candlestick marks.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartGuru.ChartType | |
xValue |
System.Single | |
value |
System.Single | |
label |
System.String | |
colorOverride |
UnityEngine.Color | |
gradientOverride |
ChartGuru.LinearGradientStyle | |
entry |
ChartGuru.ChartDataEntry |
Returns
ChartGuru.IChartMark — No return description is available.
Events
Section titled “Events”
DataChanged
Section titled “DataChanged”public event Action DataChangedRaised after ChartGuru.ChartDataSourceBase.ApplyData completes. Consumed primarily by
the UI Toolkit pipeline (ChartGuruElement) to re-pull marks.
Returns
System.Action — No return description is available.