Skip to content

MockChartDataSource

ClassChartGuruChartGuru
[AddComponentMenu("ChartGuru/Data Sources/Mock Chart Data Source")]
[ExecuteAlways]
public class MockChartDataSource : ChartDataSourceBase, IChartGuruElementDataSource, IChartDataSource

Component for generating mock chart data using the MockData system. Supports one-shot generation and continuous streaming with full configuration. Works in both Edit Mode and Play Mode.

public override void ApplyData()

Apply the generated 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 from the live mock generator without an intermediate ChartGuru.ChartGraphic. Honours the active style override.

Parameters

Name Type
chartType ChartGuru.ChartType
style ChartGuru.ChartAuthoringStyleOptions

Returns

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

public void GenerateOnce()

Generate mock data once and apply to the chart.

SetSeriesGradient(int, LinearGradientStyle)

Section titled “SetSeriesGradient(int, LinearGradientStyle)”
public void SetSeriesGradient(int seriesIndex, LinearGradientStyle gradient)

Assigns a gradient override for a specific series index. The gradient is re-applied automatically whenever data is regenerated.

Parameters

Name Type
seriesIndex System.Int32
gradient ChartGuru.LinearGradientStyle
public void ClearSeriesGradients()

Removes all per-series gradient overrides.

public void ApplySeriesGradientsToData()

Syncs the current gradient overrides into the already-generated series data and re-applies to the chart without regenerating values.

public void StartStreaming()

Start continuous data streaming.

public void StopStreaming()

Stop continuous data streaming.

public void ToggleStreaming()

Toggle streaming on/off.

public MockChartDataSource()

public SeriesPattern Pattern { get; set; }

The pattern for generating data values.

Returns

MockMagic.SeriesPattern

public int SeriesCount { get; set; }

Number of data series to generate.

Returns

System.Int32

public int PointsPerSeries { get; set; }

Number of data points per series.

Returns

System.Int32

public float MinValue { get; set; }

Minimum value for generated data.

Returns

System.Single

public float MaxValue { get; set; }

Maximum value for generated data.

Returns

System.Single

public float NoiseFactor { get; set; }

Noise factor for generated data.

Returns

System.Single

public LabelPreset LabelPreset { get; set; }

Label preset for generated data.

Returns

MockMagic.LabelPreset

public MockLabelOverflowMode LabelOverflowMode { get; set; }

Returns

ChartGuru.MockLabelOverflowMode

public int LabelStartYear { get; set; }

Returns

System.Int32

public string[] SeriesNames { get; set; }

Series names for multi-series data (optional, auto-generated if null/empty).

Returns

System.String[]

public float EmissionInterval { get; set; }

Base interval between streaming emissions (seconds).

Returns

System.Single

public int PointsPerEmission { get; set; }

Number of data points generated per streaming emission.

Returns

System.Int32

public StreamRhythm Rhythm { get; set; }

Rhythm mode for streaming data emission.

Returns

MockMagic.StreamRhythm

public bool IsStreaming { get; }

Whether streaming is currently active.

Returns

System.Boolean

public MockDataMode DataMode { get; set; }

How to handle incoming streaming data.

Returns

ChartGuru.MockDataMode

public int MaxDataPoints { get; set; }

Maximum number of data points when appending/prepending.

Returns

System.Int32

public MockChart3DDataShape DataShape3D { get; set; }

Returns

ChartGuru.MockChart3DDataShape

public bool UseDeterministicSeed { get; set; }

Returns

System.Boolean

public int Seed { get; set; }

Returns

System.Int32

public float BarWidth3D { get; set; }

Returns

System.Single

public float BarDepth3D { get; set; }

Returns

System.Single

public float SymbolSize3D { get; set; }

Returns

System.Single

public float LineThickness3D { get; set; }

Returns

System.Single

public int SurfaceResolutionX { get; set; }

Returns

System.Int32

public int SurfaceResolutionZ { get; set; }

Returns

System.Int32

public SurfaceStyle SurfaceStyle3D { get; set; }

Returns

ChartGuru.SurfaceStyle