Platforms to show: All Mac Windows Linux Cross-Platform

CDRanSeriesMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
RanSeries is a utility class to produce random series.
Example
// create random test data for a line chart
Var r As New CDRanSeriesMBS(42) // same seed gives same numbers
Var values() As Double = r.getSeries(30, 100, -5, 5, 0) // 30 values starting at 100, changing by -5 to +5, not below 0
Var dates() As Double = r.getDateSeries(30, CDBaseChartMBS.chartTime(2025, 1, 1), 86400, True) // weekdays only

Var c As New CDXYChartMBS(600, 300)
Call c.setPlotArea(50, 20, 520, 240)
Call c.addLineLayer(values, &h0066CC, "Test data")
Call c.xAxis.setLabels(dates, "{value|mm/dd}")
Var pic As Picture = c.makeChartPicture

It facilitates testing and demonstrating ChartDirector programs without needing a real data source.

  • 10 methods
    • method Constructor(seed as Integer)
    • method fillDateSeries(Values() as Double, startTime as double, tickInc as double, weekDayOnly as Boolean = false)
    • method fillSeries(Values() as Double, minValue as double, maxValue as double)
    • method fillSeries(Values() as Double, startValue as double, minDelta as double, maxDelta as double, lowerLimit as double = -1E+308, upperLimit as double = 1E+308)
    • method get2DSeries(xLen as Integer, yLen as Integer, minValue as Double, maxValue as Double) as Double()
    • method getDateSeries(len as Integer, startTime as Double, tickInc as Double, weekDayOnly as boolean = false) as Double()
    • method getSeries(len as Integer, minValue as Double, maxValue as Double) as Double()
    • method getSeries(len as Integer, startValue as Double, minDelta as Double, maxDelta as Double) as Double()
    • method getSeries(len as Integer, startValue as Double, minDelta as Double, maxDelta as Double, lowerLimit as Double) as Double()
    • method getSeries(len as Integer, startValue as Double, minDelta as Double, maxDelta as Double, lowerLimit as Double, upperLimit as Double) as Double()
  • shared method create(seed as Integer) as CDRanSeriesMBS

This class has no subclasses.

Blog Entries

Xojo Developer Magazine

Release notes

  • Version 24.0
    • Added checks for fillSeries and fillDateSeries in CDRanSeriesMBS class to better handle if arrays are nil.

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS ChartDirector Plugin.


CDRadialAxisMBS   -   CDRanTableMBS


The biggest plugin in space...