GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | List of all members
SmashHammer.UI.TimeSeriesGraph Class Reference

A time series graph UI element. More...

Inheritance diagram for SmashHammer.UI.TimeSeriesGraph:
SmashHammer.UI.Element SmashHammer.UI.ITimeSeriesGraph SmashHammer.UI.IElement SmashHammer.UI.ISizeable SmashHammer.UI.IRotatable

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.
 
void SetAlignment (Align align, float paramA, float paramB)
 Set the element's alignment.
 
void SetRotation (float angle)
 Set the element's rotation.
 
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.
 

Additional Inherited Members

- Public Types inherited from SmashHammer.UI.ISizeable
enum  Align : byte {
  LeftEdge , RightEdge , TopEdge , BottomEdge ,
  HorizEdges , VertEdges , HorizCentre , VertCentre
}
 UI element alignment mode. More...
 
- Properties inherited from SmashHammer.UI.Element
virtual bool IsVisible [get, set]
 Is the element visible?
 
- Properties inherited from SmashHammer.UI.IElement
bool IsVisible [get, set]
 Is the element visible?
 
bool IsInteractable [get, set]
 Is the element interactable?
 
bool IsTargetable [get, set]
 Is the element targetable?
 
- Properties inherited from SmashHammer.UI.ITimeSeriesGraph
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

A time series graph UI element.

Member Function Documentation

◆ CreateTimeSeries()

int SmashHammer.UI.TimeSeriesGraph.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).

Implements SmashHammer.UI.ITimeSeriesGraph.

◆ SetMinMax()

void SmashHammer.UI.TimeSeriesGraph.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.

Implements SmashHammer.UI.ITimeSeriesGraph.

◆ AddDataPoint()

void SmashHammer.UI.TimeSeriesGraph.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.

Implements SmashHammer.UI.ITimeSeriesGraph.

◆ ClearData()

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

Clear all data points from a currently existing time series.

Parameters
indexIndex of the time series.

Implements SmashHammer.UI.ITimeSeriesGraph.

◆ SetVisible()

void SmashHammer.UI.TimeSeriesGraph.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.

Implements SmashHammer.UI.ITimeSeriesGraph.