Skip to content

ManualChartDataSource

ClassChartGuruChartGuru
public class ManualChartDataSource : ChartDataSource

Values typed in the Inspector or set from code, published as a ChartDataFrame: a label, date or X column followed by one value column per series. Like every data source it feeds the chart on its GameObject and the charts below it that have no data of their own.

Colors, gradients, symbols, reference rules and 3D mark settings belong to the chart definition. The fields a Chart Guru 1.3 scene saved for them stay serialized and are not applied.

public const string LabelColumnName = "Label"

Name of the text column that holds the point labels.

Returns

System.String

public const string DateColumnName = "Date"

Name of the date column published when every label is an ISO date.

Returns

System.String

public const string XColumnName = "X"

Name of the number column published when points carry explicit X values.

Returns

System.String

public const string DefaultValueColumnName = "Value"

Name of the value column when the series has no name.

Returns

System.String

public const string CategoryColumnName = "Category"

Optional per-point columns of Single Series mode. Each is published only when a point uses it.

Returns

System.String

public const string ColorColumnName = "Color"

Returns

System.String

public const string OpacityColumnName = "Opacity"

Returns

System.String

public const string SizeColumnName = "Size"

Returns

System.String

public const string SymbolColumnName = "Symbol"

Returns

System.String

public const string RotationColumnName = "Rotation"

Returns

System.String

public const string ClipShapeColumnName = "ClipShape"

Returns

System.String

public const string ClipInsetColumnName = "ClipInset"

Returns

System.String

public const string XStartColumnName = "XStart"

Start of a range on X. A point saved with range data keeps it in its X value.

Returns

System.String

public const string XEndColumnName = "XEnd"

Returns

System.String

public const string YStartColumnName = "YStart"

Returns

System.String

public const string YEndColumnName = "YEnd"

Returns

System.String

public const string ZColumnName = "Z"

Returns

System.String

public const string ZEndColumnName = "ZEnd"

Returns

System.String

public void AddDataPoint(string label, float value)

Adds a labelled point to the single series.

Parameters

NameType
labelSystem.String
valueSystem.Single
public void AddDataPoint(string label, float value, Color color)

Adds a labelled point with its own color, published in the Color column.

Parameters

NameType
labelSystem.String
valueSystem.Single
colorUnityEngine.Color
public void AddDataPoint(float x, float y)

Adds a point with an explicit X value to the single series.

Parameters

NameType
xSystem.Single
ySystem.Single
public void InsertDataPoint(int index, string label, float value)

Inserts a labelled point into the single series.

Parameters

NameType
indexSystem.Int32
labelSystem.String
valueSystem.Single
public void InsertDataPoint(int index, float x, float y)

Inserts a point with an explicit X value into the single series.

Parameters

NameType
indexSystem.Int32
xSystem.Single
ySystem.Single
public void RemoveDataPointAt(int index)

Removes one point of the single series. An index outside the list is ignored.

Parameters

NameType
indexSystem.Int32
public void SetValue(int index, float value)

Changes the value of one point of the single series. Bound charts update the value in place.

Parameters

NameType
indexSystem.Int32
valueSystem.Single
public void ClearData()

Removes every point and series and withdraws the published frame.

public void SetData(string[] labels, float[] values)

Replaces the single series with labelled values. Extra labels or values are ignored.

Parameters

NameType
labelsSystem.String[]
valuesSystem.Single[]
public void SetData(Dictionary<string, float> data)

Replaces the single series with the entries of a dictionary, in its enumeration order.

Parameters

NameType
dataSystem.Collections.Generic.Dictionary{System.String,System.Single}
public void SetData(float[] values)

Replaces the single series with values at X positions 0, 1, 2 and so on.

Parameters

NameType
valuesSystem.Single[]
public void SetData(float[] xValues, float[] yValues)

Replaces the single series with X and Y pairs. Extra X or Y values are ignored.

Parameters

NameType
xValuesSystem.Single[]
yValuesSystem.Single[]
public void SetData(Vector2[] points)

Replaces the single series with points, X and Y taken from each vector.

Parameters

NameType
pointsUnityEngine.Vector2[]

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)

Replaces the single series with labelled values selected from a collection.

Parameters

NameType
dataSystem.Collections.Generic.IEnumerable{{T}}
labelSelectorSystem.Func{{T},System.String}
valueSelectorSystem.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)

Replaces the single series with X and Y pairs selected from a collection.

Parameters

NameType
dataSystem.Collections.Generic.IEnumerable{{T}}
xSelectorSystem.Func{{T},System.Single}
ySelectorSystem.Func{{T},System.Single}

ConfigureSingleSeries(string, IEnumerable)

Section titled “ConfigureSingleSeries(string, IEnumerable)”
public void ConfigureSingleSeries(string seriesName, IEnumerable<ChartDataEntry> dataPoints)

Switches to Single Series mode with the given name and points. The list is copied.

Parameters

NameType
seriesNameSystem.String
dataPointsSystem.Collections.Generic.IEnumerable{ChartGuru.ChartDataEntry}
public void ConfigureMultiSeries(List<ChartDataSeries> dataSeries)

Switches to Multi Series mode with the given series. The list is used as passed.

Parameters

NameType
dataSeriesSystem.Collections.Generic.List{ChartGuru.ChartDataSeries}
public override void Refresh()

Builds the frame from the current points and publishes it. Without points the frame is withdrawn.

public ManualChartDataSource()

public DataMode DataMode { get; set; }

Whether the points come from ManualChartDataSource.DataPoints or from ManualChartDataSource.DataSeries.

Returns

ChartGuru.DataMode

public string SeriesName { get; set; }

Name of the value column in Single Series mode.

Returns

System.String

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

The points of Single Series mode. Call ManualChartDataSource.Refresh() after changing the list or an entry in place.

Returns

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

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

The series of Multi Series mode. Call ManualChartDataSource.Refresh() after changing the list or a series in place.

Returns

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

public int Count { get; }

Number of points in Single Series mode, number of series in Multi Series mode.

Returns

System.Int32

public bool HasUnappliedLegacySettings { get; }

True when saved Chart Guru 1.3 styling or extra marks are present that this source no longer applies.

Returns

System.Boolean