GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | Properties | List of all members
SmashHammer.UI.ITimeSeriesGraph Interface Reference

Provides access to a UI time series graph's properties. More...

Inheritance diagram for SmashHammer.UI.ITimeSeriesGraph:
SmashHammer.UI.TimeSeriesGraph

Public Member Functions

int CreateTimeSeries (Color32Proxy colour, float lineThickness=1.0f)
 Add a new time series to the graph.
 
void DestroyAllTimeSeries ()
 Destroy all previously created time series, removing them from the graph.
 
void SetMinMax (float minValue, float maxValue)
 Set the minimum and maximum values used to scale the graph's y axis. After calling this, auto scaling is disabled, and any values outside the range will be clamped.
 
void ResetMinMax ()
 Reset back to zero the minimum and maximum values used to scale the graph's y axis.
 
void AddDataPoint (int index, float value)
 Add a data point to a currently existing time series.
 
void ClearData (int index)
 Clear all data points from a currently existing time series.
 
void SetVisible (int index, bool visible)
 Show / hide a time series.
 
void ResetAll ()
 Clear data from all currently existing time series.
 

Properties

float TimeSpan [get, set]
 The graph's time span.
 
bool AutoScale [get, set]
 Automatically adjust the graph's y axis minimum and maximum values to fit the data?
 
bool ShowReferenceLines [get, set]
 Show reference lines on the graph?
 
float ReferenceLineInterval [get, set]
 The interval between reference lines.
 
float ReferenceLineThickness [get, set]
 The reference line's thickness.
 
Color32Proxy ReferenceLineColour [get, set]
 The reference line's colour.
 
Color32Proxy AxisLineColour [get, set]
 The y = 0 reference line's colour.
 

Detailed Description

Provides access to a UI time series graph's properties.

Member Function Documentation

◆ CreateTimeSeries()

int SmashHammer.UI.ITimeSeriesGraph.CreateTimeSeries ( Color32Proxy  colour,
float  lineThickness = 1.0f 
)

Add a new time series to the graph.

Parameters
colourThe line colour to be used when plotting the time series.
lineThicknessThe line thickness to be used when plotting the time series.
Returns
Index of the newly created time series, use this to refence it when adding data points (see AddDataPoint).

Implemented in SmashHammer.UI.TimeSeriesGraph.

◆ SetMinMax()

void SmashHammer.UI.ITimeSeriesGraph.SetMinMax ( float  minValue,
float  maxValue 
)

Set the minimum and maximum values used to scale the graph's y axis. After calling this, auto scaling is disabled, and any values outside the range will be clamped.

Parameters
minValueMinimum y axis value.
maxValueMaximum y axis value.
See also
AutoScale

Also see AutoScale.

Implemented in SmashHammer.UI.TimeSeriesGraph.

◆ AddDataPoint()

void SmashHammer.UI.ITimeSeriesGraph.AddDataPoint ( int  index,
float  value 
)

Add a data point to a currently existing time series.

Parameters
indexIndex of the time series.
valueValue to add.

The data point will be time stamped with the current game time when added.

Implemented in SmashHammer.UI.TimeSeriesGraph.

◆ ClearData()

void SmashHammer.UI.ITimeSeriesGraph.ClearData ( int  index)

Clear all data points from a currently existing time series.

Parameters
indexIndex of the time series.

Implemented in SmashHammer.UI.TimeSeriesGraph.

◆ SetVisible()

void SmashHammer.UI.ITimeSeriesGraph.SetVisible ( int  index,
bool  visible 
)

Show / hide a time series.

Parameters
indexIndex of the time series.

Time series that are not visible don't contribute to y-axis auto scaling.

Implemented in SmashHammer.UI.TimeSeriesGraph.

Property Documentation

◆ TimeSpan

float SmashHammer.UI.ITimeSeriesGraph.TimeSpan
getset

The graph's time span.

The amount of historical time the graph will display, in seconds.

As time advances, any data points older than TimeSpan seconds before the current game time will be automatically deleted.

◆ AutoScale

bool SmashHammer.UI.ITimeSeriesGraph.AutoScale
getset

Automatically adjust the graph's y axis minimum and maximum values to fit the data?

Set to true to automatically scale the graph; otherwise, false.

◆ ShowReferenceLines

bool SmashHammer.UI.ITimeSeriesGraph.ShowReferenceLines
getset

Show reference lines on the graph?

Set to true to show reference lines for y = 0 and at intervals above / below (depending on ReferenceLineInterval); otherwise, false.

◆ ReferenceLineInterval

float SmashHammer.UI.ITimeSeriesGraph.ReferenceLineInterval
getset

The interval between reference lines.

The y axis interval between each reference line, set to 0 to only show the reference line at y = 0.

◆ ReferenceLineThickness

float SmashHammer.UI.ITimeSeriesGraph.ReferenceLineThickness
getset

The reference line's thickness.

The line thickness to be used when drawing the reference lines.

◆ ReferenceLineColour

Color32Proxy SmashHammer.UI.ITimeSeriesGraph.ReferenceLineColour
getset

The reference line's colour.

The colour to be used when drawing the reference lines.

◆ AxisLineColour

Color32Proxy SmashHammer.UI.ITimeSeriesGraph.AxisLineColour
getset

The y = 0 reference line's colour.

The colour to be used when drawing specifically the y = 0 reference line.