Skip to content

MockSeries

ClassMockMagiccom.wetzold.mock-magic
public static class MockSeries

Static class for generating series data with various patterns.

GenerateLabels(LabelPreset, int, int, int, string[])

Section titled “GenerateLabels(LabelPreset, int, int, int, string[])”
public static string[] GenerateLabels(LabelPreset preset, int count, int startIndex = 0, int startYear = 2020, string[] customLabels = null)

Generate labels based on preset.

Parameters

NameTypeDescription
presetMockMagic.LabelPresetThe label preset to use.
countSystem.Int32Number of labels to generate.
startIndexSystem.Int32Starting index for cycling through label arrays (used for streaming). Can be negative for prepending.
startYearSystem.Int32Starting year for year-based presets.
customLabelsSystem.String[]Custom labels for Custom preset.

Returns

System.String[]

GenerateLabels(LabelPreset, int, MockLocale, int, int, string[])

Section titled “GenerateLabels(LabelPreset, int, MockLocale, int, int, string[])”
public static string[] GenerateLabels(LabelPreset preset, int count, MockLocale locale, int startIndex = 0, int startYear = 2020, string[] customLabels = null)

Generate labels with an explicit immutable data locale, independent of the caller’s locale scope.

Parameters

NameType
presetMockMagic.LabelPreset
countSystem.Int32
localeMockMagic.MockLocale
startIndexSystem.Int32
startYearSystem.Int32
customLabelsSystem.String[]

Returns

System.String[]

GetFiniteLabelCount(LabelPreset, MockLocale)

Section titled “GetFiniteLabelCount(LabelPreset, MockLocale)”
public static int GetFiniteLabelCount(LabelPreset preset, MockLocale locale = null)

Number of labels before a finite preset cycles, or zero for an unbounded/custom preset.

Parameters

NameType
presetMockMagic.LabelPreset
localeMockMagic.MockLocale

Returns

System.Int32

Generate(SeriesPattern, int, float, float, float, LabelPreset, int, string, string[])

Section titled “Generate(SeriesPattern, int, float, float, float, LabelPreset, int, string, string[])”
public static MockDataPoint[] Generate(SeriesPattern pattern, int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric, int seriesIndex = 0, string seriesName = null, string[] customLabels = null)

Generates one labeled series whose values follow the selected shape inside the requested range, with optional random deviation.

Parameters

NameTypeDescription
patternMockMagic.SeriesPatternShape used to distribute values across the series.
countSystem.Int32Number of points to generate.
minSystem.SingleLower bound and pattern baseline.
maxSystem.SingleUpper bound and pattern peak.
noiseSystem.SingleRandom deviation as a fraction of the min to max range.
labelPresetMockMagic.LabelPresetBuilt-in label sequence applied to the points.
seriesIndexSystem.Int32Zero-based series identifier stored on every point.
seriesNameSystem.StringOptional display name stored on every point.
customLabelsSystem.String[]Labels cycled when labelPreset is LabelPreset.Custom.

Returns

MockMagic.MockDataPoint[]: A new array containing the generated points in display order.

GenerateMultiSeries(SeriesPattern, int, int, float, float, float, LabelPreset, string[], string[])

Section titled “GenerateMultiSeries(SeriesPattern, int, int, float, float, float, LabelPreset, string[], string[])”
public static MockDataPoint[][] GenerateMultiSeries(SeriesPattern pattern, int seriesCount = 3, int pointCount = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric, string[] seriesNames = null, string[] customLabels = null)

Generates multiple independent series with the same pattern and label axis.

Parameters

NameTypeDescription
patternMockMagic.SeriesPatternShape used to distribute values within each series.
seriesCountSystem.Int32Number of series to generate.
pointCountSystem.Int32Number of points in each series.
minSystem.SingleLower value bound and pattern baseline.
maxSystem.SingleUpper value bound and pattern peak.
noiseSystem.SingleRandom deviation as a fraction of the min to max range.
labelPresetMockMagic.LabelPresetBuilt-in label sequence shared by the generated series.
seriesNamesSystem.String[]Optional names matched by zero-based series index.
customLabelsSystem.String[]Labels cycled when labelPreset is LabelPreset.Custom.

Returns

MockMagic.MockDataPoint[][]: A new outer array containing one point array per series.

GenerateValues(SeriesPattern, int, float, float, float)

Section titled “GenerateValues(SeriesPattern, int, float, float, float)”
public static float[] GenerateValues(SeriesPattern pattern, int count, float min = 0, float max = 100, float noise = 0.1)

Generates raw values for a pattern without labels or series metadata.

Parameters

NameTypeDescription
patternMockMagic.SeriesPatternShape used to distribute the values.
countSystem.Int32Number of values to generate.
minSystem.SingleLower value bound and pattern baseline.
maxSystem.SingleUpper value bound and pattern peak.
noiseSystem.SingleRandom deviation as a fraction of the min to max range.

Returns

System.Single[]: A new array containing the generated values in series order.

public static MockDataPoint[] Random(int count = 12, float min = 0, float max = 100, LabelPreset labelPreset = LabelPreset.Numeric)

Generate random series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

Linear(int, float, float, float, LabelPreset)

Section titled “Linear(int, float, float, float, LabelPreset)”
public static MockDataPoint[] Linear(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric)

Generate linear series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

Exponential(int, float, float, float, LabelPreset)

Section titled “Exponential(int, float, float, float, LabelPreset)”
public static MockDataPoint[] Exponential(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric)

Generate exponential series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

Sine(int, float, float, float, LabelPreset)

Section titled “Sine(int, float, float, float, LabelPreset)”
public static MockDataPoint[] Sine(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric)

Generate sine wave series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

TrendingUp(int, float, float, float, LabelPreset)

Section titled “TrendingUp(int, float, float, float, LabelPreset)”
public static MockDataPoint[] TrendingUp(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric)

Generate trending up series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

TrendingDown(int, float, float, float, LabelPreset)

Section titled “TrendingDown(int, float, float, float, LabelPreset)”
public static MockDataPoint[] TrendingDown(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Numeric)

Generate trending down series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

Seasonal(int, float, float, float, LabelPreset)

Section titled “Seasonal(int, float, float, float, LabelPreset)”
public static MockDataPoint[] Seasonal(int count = 12, float min = 0, float max = 100, float noise = 0.1, LabelPreset labelPreset = LabelPreset.Months)

Generate seasonal series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

Stepped(int, float, float, float, LabelPreset)

Section titled “Stepped(int, float, float, float, LabelPreset)”
public static MockDataPoint[] Stepped(int count = 12, float min = 0, float max = 100, float noise = 0.05, LabelPreset labelPreset = LabelPreset.Numeric)

Generate stepped series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

public static MockDataPoint[] Sparse(int count = 12, float min = 0, float max = 100, LabelPreset labelPreset = LabelPreset.Numeric)

Generate sparse series data. Idle values are zero, or the nearest bound when the range excludes zero.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

RandomWalk(int, float, float, float, LabelPreset)

Section titled “RandomWalk(int, float, float, float, LabelPreset)”
public static MockDataPoint[] RandomWalk(int count = 12, float min = 0, float max = 100, float noise = 0.05, LabelPreset labelPreset = LabelPreset.Numeric)

Generate random walk series data (stock-like).

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

BellCurve(int, float, float, float, LabelPreset)

Section titled “BellCurve(int, float, float, float, LabelPreset)”
public static MockDataPoint[] BellCurve(int count = 12, float min = 0, float max = 100, float noise = 0.05, LabelPreset labelPreset = LabelPreset.Numeric)

Generate bell curve series data.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]

GaussianNoise(int, float, float, float, LabelPreset)

Section titled “GaussianNoise(int, float, float, float, LabelPreset)”
public static MockDataPoint[] GaussianNoise(int count = 12, float min = 0, float max = 100, float noise = 0.15, LabelPreset labelPreset = LabelPreset.Numeric)

Generate Gaussian-noise series data centred on the range midpoint.

Parameters

NameType
countSystem.Int32
minSystem.Single
maxSystem.Single
noiseSystem.Single
labelPresetMockMagic.LabelPreset

Returns

MockMagic.MockDataPoint[]