Skip to content

ManualChartDataSource

ClassChartGuruChartGuru
public class ManualChartDataSource : ChartDataSourceBase, IChartGuruElementDataSource, IChartDataSource

Component 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.

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
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
public void ClearData()

Removes all source values from the Manual Chart Data Source and notifies attached charts to refresh.

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[]
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}
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[]
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[]
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[]
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
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
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
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
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
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}
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}
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}
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}
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}

public ManualChartDataSource()

public DataMode DataMode { get; set; }

The data mode (SingleSeries or MultiSeries).

Returns

ChartGuru.DataMode

public string SeriesName { get; set; }

The name for single-series data (shown in legend).

Returns

System.String

public Color PrimaryColor { get; set; }

The primary color for single-series data. If transparent/clear, uses theme’s first series color.

Returns

UnityEngine.Color

public LinearGradientStyle PrimaryGradient { get; set; }

Returns

ChartGuru.LinearGradientStyle

public bool UsePrimaryGradient { get; set; }

Returns

System.Boolean

public List<ChartDataEntry> DataPoints { get; set; }

The data points for single-series mode.

Returns

System.Collections.Generic.List{ChartGuru.ChartDataEntry}

public List<ChartDataSeries> DataSeries { get; set; }

The data series for multi-series mode.

Returns

System.Collections.Generic.List{ChartGuru.ChartDataSeries}

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