ManualChartDataSource
public class ManualChartDataSource : ChartDataSourceBase, IChartGuruElementDataSource, IChartDataSourceComponent for defining chart data manually in the Inspector. Attach to the same GameObject as ChartGraphic or reference a ChartGraphic. Supports single series and multi-series data with automatic updates.
Methods
Section titled “Methods”
AddDataPoint(string, float)
Section titled “AddDataPoint(string, float)”public void AddDataPoint(string label, float value)Appends one data point to the series and notifies attached charts that their rendered data changed.
Parameters
| Name | Type |
|---|---|
label |
System.String |
value |
System.Single |
AddDataPoint(string, float, Color)
Section titled “AddDataPoint(string, float, Color)”public void AddDataPoint(string label, float value, Color color)Appends one data point to the series and notifies attached charts that their rendered data changed.
Parameters
| Name | Type |
|---|---|
label |
System.String |
value |
System.Single |
color |
UnityEngine.Color |
ClearData()
Section titled “ClearData()”public void ClearData()Removes all source values from the Manual Chart Data Source and notifies attached charts to refresh.
SetData(string[], float[])
Section titled “SetData(string[], float[])”public void SetData(string[] labels, float[] values)Replaces the Manual Chart Data Source’s source data and refreshes its marks while preserving compatible chart configuration.
Parameters
| Name | Type |
|---|---|
labels |
System.String[] |
values |
System.Single[] |
SetData(Dictionary<string, float>)
Section titled “SetData(Dictionary<string, float>)”public void SetData(Dictionary<string, float> data)Replaces the Manual Chart Data Source’s source data and refreshes its marks while preserving compatible chart configuration.
Parameters
| Name | Type |
|---|---|
data |
System.Collections.Generic.Dictionary{System.String,System.Single} |
SetData(float[])
Section titled “SetData(float[])”public void SetData(float[] values)Replaces the Manual Chart Data Source’s source data and refreshes its marks while preserving compatible chart configuration.
Parameters
| Name | Type |
|---|---|
values |
System.Single[] |
SetData(float[], float[])
Section titled “SetData(float[], float[])”public void SetData(float[] xValues, float[] yValues)Replaces the Manual Chart Data Source’s source data and refreshes its marks while preserving compatible chart configuration.
Parameters
| Name | Type |
|---|---|
xValues |
System.Single[] |
yValues |
System.Single[] |
SetData(Vector2[])
Section titled “SetData(Vector2[])”public void SetData(Vector2[] points)Replaces the Manual Chart Data Source’s source data and refreshes its marks while preserving compatible chart configuration.
Parameters
| Name | Type |
|---|---|
points |
UnityEngine.Vector2[] |
AddDataPoint(float, float)
Section titled “AddDataPoint(float, float)”public void AddDataPoint(float x, float y)Appends one data point to the series and notifies attached charts that their rendered data changed.
Parameters
| Name | Type |
|---|---|
x |
System.Single |
y |
System.Single |
InsertDataPoint(int, string, float)
Section titled “InsertDataPoint(int, string, float)”public void InsertDataPoint(int index, string label, float value)Inserts one data point at the requested position and notifies attached charts that their rendered data changed.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
label |
System.String |
value |
System.Single |
InsertDataPoint(int, float, float)
Section titled “InsertDataPoint(int, float, float)”public void InsertDataPoint(int index, float x, float y)Inserts one data point at the requested position and notifies attached charts that their rendered data changed.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
x |
System.Single |
y |
System.Single |
RemoveDataPointAt(int)
Section titled “RemoveDataPointAt(int)”public void RemoveDataPointAt(int index)Removes the data point at the requested index and notifies attached charts when removal succeeds.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
SetValue(int, float)
Section titled “SetValue(int, float)”public void SetValue(int index, float value)Replaces one point’s value by index and immediately reapplies the source to all resolved chart targets.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
value |
System.Single |
ConfigureSingleSeries(string, Color, List, LinearGradientStyle)
Section titled “ConfigureSingleSeries(string, Color, List, LinearGradientStyle)”public void ConfigureSingleSeries(string seriesName, Color primaryColor, List<ChartDataEntry> dataPoints, LinearGradientStyle primaryGradient = null)Replaces the source with one named series, including its points and optional solid or gradient styling.
Parameters
| Name | Type |
|---|---|
seriesName |
System.String |
primaryColor |
UnityEngine.Color |
dataPoints |
System.Collections.Generic.List{ChartGuru.ChartDataEntry} |
primaryGradient |
ChartGuru.LinearGradientStyle |
ConfigureMultiSeries(List)
Section titled “ConfigureMultiSeries(List)”public void ConfigureMultiSeries(List<ChartDataSeries> dataSeries)Replaces the source with the supplied ordered series collection and schedules all target charts to rebuild.
Parameters
| Name | Type |
|---|---|
dataSeries |
System.Collections.Generic.List{ChartGuru.ChartDataSeries} |
ConfigureSurfaceGrid3D(string, SurfaceStyle, int, int, List)
Section titled “ConfigureSurfaceGrid3D(string, SurfaceStyle, int, int, List)”public void ConfigureSurfaceGrid3D(string seriesName, SurfaceStyle style, int resolutionX, int resolutionZ, List<ChartDataEntry> samples)Configures a sampled surface grid with explicit X/Z resolution and series styling for supported 3D charts.
Parameters
| Name | Type |
|---|---|
seriesName |
System.String |
style |
ChartGuru.SurfaceStyle |
resolutionX |
System.Int32 |
resolutionZ |
System.Int32 |
samples |
System.Collections.Generic.List{ChartGuru.ChartDataEntry} |
ConfigureOverlayPoints(List)
Section titled “ConfigureOverlayPoints(List)”public void ConfigureOverlayPoints(List<ChartDataEntry> overlayPoints)Replaces supplemental point overlays without changing the source’s primary series data.
Parameters
| Name | Type |
|---|---|
overlayPoints |
System.Collections.Generic.List{ChartGuru.ChartDataEntry} |
ConfigureOverlayRectangles(List)
Section titled “ConfigureOverlayRectangles(List)”public void ConfigureOverlayRectangles(List<ChartOverlayRectangleEntry> overlayRectangles)Replaces supplemental rectangle overlays, cloning entries so later caller mutations do not alter the source.
Parameters
| Name | Type |
|---|---|
overlayRectangles |
System.Collections.Generic.List{ChartGuru.ChartOverlayRectangleEntry} |
ConfigureReferenceRules(List)
Section titled “ConfigureReferenceRules(List)”public void ConfigureReferenceRules(List<ManualChartReferenceRule> referenceRules)Replaces the horizontal and vertical reference rules displayed with the source data.
Parameters
| Name | Type |
|---|---|
referenceRules |
System.Collections.Generic.List{ChartGuru.ManualChartReferenceRule} |
ApplyData()
Section titled “ApplyData()”public override void ApplyData()Apply the configured data to all resolved target charts — both 2D ChartGuru.ChartGraphic targets and optional 3D ChartGuru.IChart3DHost targets (routed via ChartGuru.Chart3DIntegration when the ThreeD add-on is loaded).
BuildMarksForChartType(ChartType, ChartAuthoringStyleOptions)
Section titled “BuildMarksForChartType(ChartType, ChartAuthoringStyleOptions)”public override List<IChartMark> BuildMarksForChartType(ChartType chartType, ChartAuthoringStyleOptions style)Override that lets a UI Toolkit ChartGuruElement pull marks
directly without an intermediate ChartGuru.ChartGraphic. The base
class sets the active style override before calling, so existing
Get* helpers transparently read the UITK style.
Parameters
| Name | Type |
|---|---|
chartType |
ChartGuru.ChartType |
style |
ChartGuru.ChartAuthoringStyleOptions |
Returns
System.Collections.Generic.List{ChartGuru.IChartMark}
SetData(IEnumerable, Func<T, string>, Func<T, float>)
Section titled “SetData(IEnumerable, Func<T, string>, Func<T, float>)”public void SetData<T>(IEnumerable<T> data, Func<T, string> labelSelector, Func<T, float> valueSelector)Set data from an arbitrary collection using a label and value selector.
Parameters
| Name | Type |
|---|---|
data |
System.Collections.Generic.IEnumerable{{T}} |
labelSelector |
System.Func{{T},System.String} |
valueSelector |
System.Func{{T},System.Single} |
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)Set data from an arbitrary collection using X and Y selectors.
Parameters
| Name | Type |
|---|---|
data |
System.Collections.Generic.IEnumerable{{T}} |
xSelector |
System.Func{{T},System.Single} |
ySelector |
System.Func{{T},System.Single} |
Constructors
Section titled “Constructors”
ManualChartDataSource()
Section titled “ManualChartDataSource()”public ManualChartDataSource()Properties
Section titled “Properties”
DataMode
Section titled “DataMode”public DataMode DataMode { get; set; }The data mode (SingleSeries or MultiSeries).
Returns
ChartGuru.DataMode
SeriesName
Section titled “SeriesName”public string SeriesName { get; set; }The name for single-series data (shown in legend).
Returns
System.String
PrimaryColor
Section titled “PrimaryColor”public Color PrimaryColor { get; set; }The primary color for single-series data. If transparent/clear, uses theme’s first series color.
Returns
UnityEngine.Color
PrimaryGradient
Section titled “PrimaryGradient”public LinearGradientStyle PrimaryGradient { get; set; }Returns
ChartGuru.LinearGradientStyle
UsePrimaryGradient
Section titled “UsePrimaryGradient”public bool UsePrimaryGradient { get; set; }Returns
System.Boolean
DataPoints
Section titled “DataPoints”public List<ChartDataEntry> DataPoints { get; set; }The data points for single-series mode.
Returns
System.Collections.Generic.List{ChartGuru.ChartDataEntry}
DataSeries
Section titled “DataSeries”public List<ChartDataSeries> DataSeries { get; set; }The data series for multi-series mode.
Returns
System.Collections.Generic.List{ChartGuru.ChartDataSeries}
UseSymbols
Section titled “UseSymbols”public bool UseSymbols { get; set; }Returns
System.Boolean
public int Count { get; }Number of data points in single-series mode, or total across all series in multi-series mode.
Returns
System.Int32