Graph Maker
WMG_Axis_Graph Class Reference

Used for all charts that use axes to position data. More...

Inheritance diagram for WMG_Axis_Graph:
WMG_Graph_Manager WMG_Events WMG_GUI_Functions WMG_Text_Functions WMG_Radar_Graph

Public Types

enum  graphTypes {
  graphTypes.line, graphTypes.line_stacked, graphTypes.bar_side, graphTypes.bar_stacked,
  graphTypes.bar_stacked_percent, graphTypes.combo
}
 
enum  orientationTypes { orientationTypes.vertical, orientationTypes.horizontal }
 
enum  axesTypes {
  axesTypes.MANUAL, axesTypes.CENTER, axesTypes.AUTO_ORIGIN, axesTypes.AUTO_ORIGIN_X,
  axesTypes.AUTO_ORIGIN_Y, axesTypes.I, axesTypes.II, axesTypes.III,
  axesTypes.IV, axesTypes.I_II, axesTypes.III_IV, axesTypes.II_III,
  axesTypes.I_IV, axesTypes.DUAL_Y
}
 
enum  ResizeProperties {
  ResizeProperties.SeriesPointSize = 1 << 0, ResizeProperties.SeriesLineWidth = 1 << 1, ResizeProperties.SeriesDataLabelSize = 1 << 2, ResizeProperties.SeriesDataLabelOffset = 1 << 3,
  ResizeProperties.LegendFontSize = 1 << 4, ResizeProperties.LegendEntrySize = 1 << 5, ResizeProperties.LegendOffset = 1 << 6, ResizeProperties.AxesWidth = 1 << 7,
  ResizeProperties.AxesLabelSize = 1 << 8, ResizeProperties.AxesLabelOffset = 1 << 9, ResizeProperties.AxesTitleSize = 1 << 10, ResizeProperties.AxesLinePadding = 1 << 11,
  ResizeProperties.AxesArrowSize = 1 << 12, ResizeProperties.AutoPaddingAmount = 1 << 13, ResizeProperties.BorderPadding = 1 << 14, ResizeProperties.TickSize = 1 << 15,
  ResizeProperties.AxisTitleOffset = 1 << 16, ResizeProperties.GraphTitleSize = 1 << 17, ResizeProperties.GraphTitleOffset = 1 << 18
}
 
enum  AutoPaddingProperties {
  AutoPaddingProperties.Legend = 1 << 0, AutoPaddingProperties.XaxisTitle = 1 << 1, AutoPaddingProperties.YaxisTitle = 1 << 2, AutoPaddingProperties.Y2axisTitle = 1 << 3,
  AutoPaddingProperties.Title = 1 << 4
}
 
- Public Types inherited from WMG_Text_Functions
enum  WMGpivotTypes {
  WMGpivotTypes.Bottom, WMGpivotTypes.BottomLeft, WMGpivotTypes.BottomRight, WMGpivotTypes.Center,
  WMGpivotTypes.Left, WMGpivotTypes.Right, WMGpivotTypes.Top, WMGpivotTypes.TopLeft,
  WMGpivotTypes.TopRight
}
 

Public Member Functions

int getMaxNumPoints ()
 The max number of points across all series. More...
 
int getMaxSeriesBarCount ()
 The max number of bars across all series. More...
 
int NumComboBarSeries ()
 The number of series that are combo bar series. More...
 
delegate void GraphBackgroundChangedHandler (WMG_Axis_Graph aGraph)
 
void Init ()
 Initializes the graph, and should always be done before anything else, called automatically in Start(), but it never hurts to call this manually after instantiating a graph prefab. More...
 
void Refresh ()
 Refreshes the graph, and happens automatically in Update(), but sometimes it is useful or necessary to call this manually, note that refresh updates only the parts of the graph affected by properties that have changed since a last refresh. More...
 
void ManualResize ()
 Useful if resizeEnabled = false, and you want to resize graph content manually by calling this when you want. More...
 
void SeriesChanged (bool countChanged, bool instant)
 Happens when a series points changed, this should not be used outside of Graph Maker code. More...
 
void aSeriesPointsChanged ()
 Happens when a series points changed, this should not be used outside of Graph Maker code. More...
 
void GraphChanged ()
 Happens when various elements of the graph has changed, this should not be used outside of Graph Maker code. More...
 
void setOriginalPropertyValues ()
 Caches initial property values that are used as the basis for resizeEnabled functionality. More...
 
void UpdateOrientation ()
 Updates the graph orientation, this should not be used outside of Graph Maker code. More...
 
void InEditorUpdate ()
 Update called from Editor window, should not be used outside of Graph Maker code. More...
 
float getDistBetween (int pointsCount, float theAxisLength)
 
void changeAllLinePivots (WMGpivotTypes newPivot)
 
List< Vector3 > getSeriesScaleVectors (bool useLineWidthForX, float x, float y)
 
float getMaxPointSize ()
 
void animScaleAllAtOnce (bool isPoint, float duration, float delay, Ease anEaseType, List< Vector3 > before, List< Vector3 > after)
 Animate all the points in all the series simultaneously. More...
 
void animScaleBySeries (bool isPoint, float duration, float delay, Ease anEaseType, List< Vector3 > before, List< Vector3 > after)
 Animate all the points in a single series simultaneously, and then proceed to the next series. More...
 
void animScaleOneByOne (bool isPoint, float duration, float delay, Ease anEaseType, List< Vector3 > before, List< Vector3 > after, int loopDir)
 Animate the points across multiple series simultaneously, and then proceed to the next points. More...
 
WMG_Series addSeries ()
 Create a new series and append it to the end. More...
 
void deleteSeries ()
 Delete the last series. More...
 
WMG_Series addSeriesAt (int index, WMG_Series.comboTypes comboType=WMG_Series.comboTypes.line)
 Create a new series and insert it at the specified index. More...
 
void deleteSeriesAt (int index)
 Delete a series at the specified index. More...
 
List< WMG_NodegetXAxisTicks ()
 Obsolete. More...
 
List< WMG_NodegetXAxisLabels ()
 Obsolete. More...
 
List< WMG_NodegetYAxisTicks ()
 Obsolete. More...
 
List< WMG_NodegetYAxisLabels ()
 Obsolete. More...
 
- Public Member Functions inherited from WMG_Graph_Manager
GameObject CreateNode (Object prefabNode, GameObject parent)
 Creates a node for this graph. More...
 
GameObject CreateLink (WMG_Node fromNode, GameObject toNode, Object prefabLink, GameObject parent)
 Creates a link for this graph, and repositions the link. More...
 
GameObject CreateLinkNoRepos (WMG_Node fromNode, GameObject toNode, Object prefabLink, GameObject parent)
 Creates a link for this graph, and does not repoisition the link. More...
 
WMG_Link GetLink (WMG_Node fromNode, WMG_Node toNode)
 Given two nodes, get the link between those nodes for this graph. More...
 
GameObject ReplaceNodeWithNewPrefab (WMG_Node theNode, Object prefabNode)
 Given a node, and a prefab, re-instantiate the node using the specified prefab which has a WMG_Node script attached. More...
 
void DeleteNode (WMG_Node theNode)
 Deletes a node. More...
 
void DeleteLink (WMG_Link theLink)
 Deletes a link. More...
 
List< WMG_LinkFindShortestPathBetweenNodes (WMG_Node fromNode, WMG_Node toNode)
 Given two nodes return one or more shortest paths between the nodes based on the number of links (unweighted), using Breadth-first search algorithm. More...
 
List< WMG_LinkFindShortestPathBetweenNodesWeighted (WMG_Node fromNode, WMG_Node toNode, bool includeRadii)
 Given two nodes return one or more shortest paths between the nodes based on the link weights (weighted), and also node radii if include radii is true, using Dijkstra's algorithm. More...
 
- Public Member Functions inherited from WMG_Events
delegate void WMG_Click_H (WMG_Series aSeries, WMG_Node aNode, PointerEventData pointerEventData)
 
void addNodeClickEvent (GameObject go)
 
delegate void WMG_Link_Click_H (WMG_Series aSeries, WMG_Link aLink, PointerEventData pointerEventData)
 
void addLinkClickEvent (GameObject go)
 
delegate void WMG_Click_Leg_H (WMG_Series aSeries, WMG_Node aNode, PointerEventData pointerEventData)
 
void addNodeClickEvent_Leg (GameObject go)
 
delegate void WMG_Link_Click_Leg_H (WMG_Series aSeries, WMG_Link aLink, PointerEventData pointerEventData)
 
void addLinkClickEvent_Leg (GameObject go)
 
delegate void WMG_Pie_Slice_Click_H (WMG_Pie_Graph pieGraph, WMG_Pie_Graph_Slice aSlice, PointerEventData pointerEventData)
 
void addPieSliceClickEvent (GameObject go)
 
delegate void WMG_Pie_Legend_Entry_Click_H (WMG_Pie_Graph pieGraph, WMG_Legend_Entry legendEntry, PointerEventData pointerEventData)
 
void addPieLegendEntryClickEvent (GameObject go)
 
delegate void WMG_Ring_Click_H (WMG_Ring ring, PointerEventData pointerEventData)
 
void addRingClickEvent (GameObject go)
 
delegate void WMG_MouseEnter_H (WMG_Series aSeries, WMG_Node aNode, bool state)
 
void addNodeMouseEnterEvent (GameObject go)
 
delegate void WMG_Link_MouseEnter_H (WMG_Series aSeries, WMG_Link aLink, bool state)
 
void addLinkMouseEnterEvent (GameObject go)
 
delegate void WMG_MouseEnter_Leg_H (WMG_Series aSeries, WMG_Node aNode, bool state)
 
void addNodeMouseEnterEvent_Leg (GameObject go)
 
delegate void WMG_Link_MouseEnter_Leg_H (WMG_Series aSeries, WMG_Link aLink, bool state)
 
void addLinkMouseEnterEvent_Leg (GameObject go)
 
delegate void WMG_Pie_Slice_MouseEnter_H (WMG_Pie_Graph pieGraph, WMG_Pie_Graph_Slice aSlice, bool state)
 
void addPieSliceMouseEnterEvent (GameObject go)
 
delegate void WMG_Ring_MouseEnter_H (WMG_Ring ring, bool state)
 
void addRingMouseEnterEvent (GameObject go)
 
void addNodeMouseLeaveEvent (GameObject go)
 
void addLinkMouseLeaveEvent (GameObject go)
 
void addNodeMouseLeaveEvent_Leg (GameObject go)
 
void addLinkMouseLeaveEvent_Leg (GameObject go)
 
- Public Member Functions inherited from WMG_GUI_Functions
void SetActive (GameObject obj, bool state)
 
bool activeInHierarchy (GameObject obj)
 
void SetActiveAnchoredSprite (GameObject obj, bool state)
 
void SetActiveImage (GameObject obj, bool state)
 
Texture2D getTexture (GameObject obj)
 
void setTexture (GameObject obj, Sprite sprite)
 
void changeSpriteFill (GameObject obj, float fill)
 
void changeRadialSpriteRotation (GameObject obj, Vector3 newRot)
 
void changeSpriteColor (GameObject obj, Color aColor)
 
void changeSpriteAlpha (GameObject obj, float alpha)
 
float getSpriteAlpha (GameObject obj)
 
void changeSpriteWidth (GameObject obj, int aWidth)
 
void changeSpriteHeight (GameObject obj, int aHeight)
 
void setTextureMaterial (GameObject obj, Material aMat)
 
Material getTextureMaterial (GameObject obj)
 
void changeSpriteSize (GameObject obj, int aWidth, int aHeight)
 
void changeSpriteSizeFloat (GameObject obj, float aWidth, float aHeight)
 
Vector2 getSpriteSize (GameObject obj)
 
void changeBarWidthHeight (GameObject obj, int aWidth, int aHeight)
 
float getSpriteWidth (GameObject obj)
 
float getSpriteHeight (GameObject obj)
 
float getTextWidth (GameObject obj)
 
float getTextHeight (GameObject obj)
 
void forceUpdateText (GameObject obj)
 
void setAnchor (GameObject go, Vector2 anchor, Vector2 pivot, Vector2 anchoredPosition)
 
void setAnchoredPosition (GameObject go, Vector2 anchoredPosition)
 
void stretchToParent (GameObject go)
 
bool rectIntersectRect (GameObject r1, GameObject r2)
 
void getRectDiffs (GameObject child, GameObject container, ref Vector2 xDif, ref Vector2 yDif)
 
float getSpritePositionX (GameObject obj)
 
float getSpritePositionY (GameObject obj)
 
Vector2 getSpritePositionXY (GameObject obj)
 
float getSpritePivotTopToBot (GameObject obj)
 
Vector3 getPositionRelativeTransform (GameObject obj, GameObject relative)
 
void changePositionByRelativeTransform (GameObject obj, GameObject relative, Vector2 delta)
 
void changeSpritePositionTo (GameObject obj, Vector3 newPos)
 
void changeSpritePositionToX (GameObject obj, float newPos)
 
void changeSpritePositionToY (GameObject obj, float newPos)
 
Vector2 getChangeSpritePositionTo (GameObject obj, Vector2 newPos)
 
void changeSpritePositionRelativeToObjBy (GameObject obj, GameObject relObj, Vector3 changeAmt)
 
void changeSpritePositionRelativeToObjByX (GameObject obj, GameObject relObj, float changeAmt)
 
void changeSpritePositionRelativeToObjByY (GameObject obj, GameObject relObj, float changeAmt)
 
Vector2 getSpritePivot (GameObject obj)
 
void changeSpriteParent (GameObject child, GameObject parent)
 
void getFirstCanvasOnSelfOrParent (Transform trans, ref Canvas canv)
 
void addRaycaster (GameObject obj)
 
void setAsNotInteractible (GameObject obj)
 
void bringSpriteToFront (GameObject obj)
 
void sendSpriteToBack (GameObject obj)
 
- Public Member Functions inherited from WMG_Text_Functions
void changeLabelText (GameObject obj, string aText)
 
void changeLabelFontSize (GameObject obj, int newFontSize)
 
Vector2 getTextSize (GameObject obj)
 
void changeSpritePivot (GameObject obj, WMGpivotTypes theType)
 
void changeLabelColor (GameObject obj, Color newColor)
 
void changeLabelFontStyle (GameObject obj, FontStyle newFontStyle)
 
void changeLabelFont (GameObject obj, Font newFont)
 

Public Attributes

WMG_Axis yAxis
 The y axis. More...
 
WMG_Axis xAxis
 The x axis. More...
 
WMG_Axis yAxis2
 The secondary y axis when axesType = DUAL_Y. More...
 
WMG_List< string > groups = new WMG_List<string>()
 The list of groups used, see useGroups for info about groups. More...
 
Vector2 tooltipOffset
 The positional offset from the bottom left corner of the tooltip from the mouse cursor. More...
 
int tooltipNumberDecimals
 The numbr of decimals used when data is displayed in the tooltip. More...
 
bool tooltipDisplaySeriesName
 Whether or not the tooltip also displays the WMG_Series::seriesName to the left of the data in the tooltip. More...
 
bool tooltipAnimationsEnabled
 Whether or not an animation plays (e.g. More...
 
Ease tooltipAnimationsEasetype
 The tooltip animations easetype. More...
 
float tooltipAnimationsDuration
 The duration of the tooltip animations. More...
 
Ease autoAnimationsEasetype
 The auto animations easetype. More...
 
float autoAnimationsDuration
 The duration of the auto animations. More...
 
List< GameObject > lineSeries
 The list of series for this graph, it is a GameObject list, but each GameObject must have a WMG_Series. More...
 
List< Object > pointPrefabs
 The list of line series point prefabs to which WMG_Series::pointPrefab corresponds, for which a value of 0 will mean to use the first prefab in this list. More...
 
List< Object > linkPrefabs
 The list of line series line prefabs to which WMG_Series::linkPrefab corresponds, for which a value of 0 will mean to use the first prefab in this list. More...
 
Object barPrefab
 For bar graphs, this is the prefab used in drawing the bars for all series. More...
 
Object seriesPrefab
 Dynamically adding series with addSeries or addSeriesAt functions will use this prefab to create the new series. More...
 
WMG_Legend legend
 The legend. More...
 
GameObject graphTitle
 The graph title. More...
 
GameObject graphBackground
 The graph background. More...
 
GameObject anchoredParent
 A GameObject similar to the Graph Background object, but whose child objects use anchoring to position such as the legend. More...
 
GameObject graphAreaBoundsParent
 A GameObject whose RectTransform defines the bounding box formed by the graph's axes. More...
 
GameObject seriesParent
 The WMG_Series objects have this as their parent. More...
 
GameObject toolTipPanel
 The tool tip panel / parent. More...
 
GameObject toolTipLabel
 The tool tip label. More...
 
WMG_Graph_Tooltip theTooltip
 The tooltip. More...
 
bool resizingChangesFontScaleInsteadOfFontSize = false
 When resizeEnabled = true, the resizing process for Text objects will change the objects scale instead of font size when this is true. More...
 
WMG_Change_Obj graphC = new WMG_Change_Obj()
 
WMG_Change_Obj seriesCountC = new WMG_Change_Obj()
 
WMG_Change_Obj seriesNoCountC = new WMG_Change_Obj()
 
WMG_Change_Obj autoPaddingC = new WMG_Change_Obj()
 

Protected Member Functions

virtual void OnGraphBackgroundChanged ()
 

Properties

graphTypes graphType [get, set]
 Gets or sets the type of the graph, which determines at a high level how data will be displayed. More...
 
orientationTypes orientationType [get, set]
 Gets or sets the type of the orientation, where vertical means the y-axis data will be displayed vertically. More...
 
axesTypes axesType [get, set]
 Determines how axes are oriented, the roman numerals refer to quadrants where quadrant 1 is the top right, and quadrant 4 is bottom right. More...
 
bool resizeEnabled [get, set]
 Determines whether graph content (resizeProperties) will resize post graph initialization based on the percentage change of the graph's rect transform width / height. More...
 
ResizeProperties resizeProperties [get, set]
 Specifies which graph content is resized when resizeEnabled = true. More...
 
bool useGroups [get, set]
 Determines whether the data for each series corresponds to an element in groups, where the (group index + 1) corresponds with WMG_Series::pointValues x value. More...
 
Vector2 paddingLeftRight [get, set]
 The amount of space on the left / right sides of the graph content formed by bounding box of the axis lines, and set automatically if autoPaddingEnabled = true. More...
 
Vector2 paddingTopBottom [get, set]
 The amount of space on the top / bottom sides of the graph content formed by bounding box of the axis lines, and set automatically if autoPaddingEnabled = true. More...
 
bool autoPaddingEnabled [get, set]
 When enabled, automatically sets paddingLeftRight and paddingTopBottom based on autoPaddingProperties and autoPaddingAmount. More...
 
AutoPaddingProperties autoPaddingProperties [get, set]
 The elements of graph content that is taken into consideration when autoPaddingEnabled = true. More...
 
float autoPaddingAmount [get, set]
 This is the amount of padding space between the graph content and graph boundary that is used when autoPaddingEnabled = true. More...
 
Vector2 theOrigin [get, set]
 The origin of the graph, affects position of axes if axesType is of an AUTO_ORIGIN type, also affects barAxisValue if autoUpdateBarAxisValue = true. More...
 
float barWidth [get, set]
 Determines the width of the series' bars for bar graphs. More...
 
float barAxisValue [get, set]
 Controls the starting point for bar charts. More...
 
bool autoUpdateOrigin [get, set]
 When enabled, automatically sets theOrigin based on axesType. More...
 
bool autoUpdateBarWidth [get, set]
 When enabled, automatically updates barWidth based on autoUpdateBarWidthSpacing. More...
 
float autoUpdateBarWidthSpacing [get, set]
 When autoUpdateBarWidth = true, automatically updates barWidth based on this specified percentage of the graph's axis length. More...
 
bool autoUpdateSeriesAxisSpacing [get, set]
 When enabled, automatically updates WMG_Series::extraXSpace, which is the padding of space for the series from the axis line. More...
 
bool autoUpdateBarAxisValue [get, set]
 When enabled, automatically updates barAxisValue based on the theOrigin. More...
 
int axisWidth [get, set]
 Determines the width of the x / y axis lines. More...
 
float autoShrinkAtPercent [get, set]
 When WMG_Axis::MinAutoShrink = true or WMG_Axis::MaxAutoShrink = true, determines percentage threshold at which an auto shrink occurs. More...
 
float autoGrowAndShrinkByPercent [get, set]
 When WMG_Axis::MinAutoShrink = true, WMG_Axis::MaxAutoShrink = true, WMG_Axis::MinAutoGrow = true, or WMG_Axis::MaxAutoGrow = true, determines the amount of an auto shrink / growth. More...
 
bool tooltipEnabled [get, set]
 Determines whether to show a tooltip when the mouse hovers over a series data point / bar. More...
 
bool autoAnimationsEnabled [get, set]
 When enabled, certain changes will automatically play an animation such as a data point changing its y-value, or the graph orientation changing. More...
 
Vector2 tickSize [get, set]
 Determines the width and height of axis ticks, for which there are WMG_Axis::AxisNumTicks if WMG_Axis::hideTicks = false. More...
 
string graphTitleString [get, set]
 The string to display for the title of the graph, which appears at the top of the graph. More...
 
Vector2 graphTitleOffset [get, set]
 The positional offset of graphTitleString used to control how much space there is between the graph title and the graph. More...
 
int graphTitleSize [get, set]
 The font size of graphTitleString. More...
 
float xAxisLength [get]
 
float yAxisLength [get]
 
float xAxisLengthOrienInd [get]
 
float yAxisLengthOrienInd [get]
 
bool IsStacked [get]
 
List< float > TotalPointValues [get]
 Contains the summed values for series' data, used for stacked charts. More...
 
bool autoFitLabels [get, set]
 Obsolete. More...
 
float autoFitPadding [get, set]
 Obsolete. More...
 
- Properties inherited from WMG_Graph_Manager
List< GameObject > NodesParent [get]
 The list of GameObjects which are WMG_Nodes for this graph. More...
 
List< GameObject > LinksParent [get]
 The list of GameObjects which are WMG_Links for this graph. More...
 

Events

GraphBackgroundChangedHandler GraphBackgroundChanged
 
- Events inherited from WMG_Events
WMG_Click_H WMG_Click
 Occurs when a series point is clicked. More...
 
WMG_Link_Click_H WMG_Link_Click
 Occurs when a series link / line is clicked. More...
 
WMG_Click_Leg_H WMG_Click_Leg
 Occurs when a series legend node / swatch is clicked. More...
 
WMG_Link_Click_Leg_H WMG_Link_Click_Leg
 Occurs when a series legend link / line is clicked. More...
 
WMG_Pie_Slice_Click_H WMG_Pie_Slice_Click
 Occurs when a pie graph slice is clicked. More...
 
WMG_Pie_Legend_Entry_Click_H WMG_Pie_Legend_Entry_Click
 Occurs when a pie graph legend swatch is clicked. More...
 
WMG_Ring_Click_H WMG_Ring_Click
 Occurs when a ring graph ring / band is clicked. More...
 
WMG_MouseEnter_H WMG_MouseEnter
 Occurs when a series point is hovered. More...
 
WMG_Link_MouseEnter_H WMG_Link_MouseEnter
 Occurs when a series link / line is hovered. More...
 
WMG_MouseEnter_Leg_H WMG_MouseEnter_Leg
 Occurs when a series legend node / swatch is hovered. More...
 
WMG_Link_MouseEnter_Leg_H WMG_Link_MouseEnter_Leg
 Occurs when a series legend link / line is hovered. More...
 
WMG_Pie_Slice_MouseEnter_H WMG_Pie_Slice_MouseEnter
 Occurs when a pie graph slice is hovered. More...
 
WMG_Ring_MouseEnter_H WMG_Ring_MouseEnter
 Occurs when a ring graph ring / band is hovered. More...
 

Detailed Description

Used for all charts that use axes to position data.

Member Enumeration Documentation

◆ AutoPaddingProperties

Enumerator
Legend 
XaxisTitle 
YaxisTitle 
Y2axisTitle 
Title 

◆ axesTypes

Enumerator
MANUAL 
CENTER 
AUTO_ORIGIN 
AUTO_ORIGIN_X 
AUTO_ORIGIN_Y 
II 
III 
IV 
I_II 
III_IV 
II_III 
I_IV 
DUAL_Y 

◆ graphTypes

Enumerator
line 
line_stacked 
bar_side 
bar_stacked 
bar_stacked_percent 
combo 

◆ orientationTypes

Enumerator
vertical 
horizontal 

◆ ResizeProperties

Enumerator
SeriesPointSize 
SeriesLineWidth 
SeriesDataLabelSize 
SeriesDataLabelOffset 
LegendFontSize 
LegendEntrySize 
LegendOffset 
AxesWidth 
AxesLabelSize 
AxesLabelOffset 
AxesTitleSize 
AxesLinePadding 
AxesArrowSize 
AutoPaddingAmount 
BorderPadding 
TickSize 
AxisTitleOffset 
GraphTitleSize 
GraphTitleOffset 

Member Function Documentation

◆ addSeries()

WMG_Series WMG_Axis_Graph.addSeries ( )

Create a new series and append it to the end.

Returns
The series.

◆ addSeriesAt()

WMG_Series WMG_Axis_Graph.addSeriesAt ( int  index,
WMG_Series.comboTypes  comboType = WMG_Series.comboTypes.line 
)

Create a new series and insert it at the specified index.

Returns
The WMG_Series.
Parameters
indexIndex.
comboTypeCombo type.

◆ animScaleAllAtOnce()

void WMG_Axis_Graph.animScaleAllAtOnce ( bool  isPoint,
float  duration,
float  delay,
Ease  anEaseType,
List< Vector3 >  before,
List< Vector3 >  after 
)

Animate all the points in all the series simultaneously.

Parameters
isPointIf set to true is point.
durationDuration.
delayDelay.
anEaseTypeAn ease type.
beforeBefore.
afterAfter.

◆ animScaleBySeries()

void WMG_Axis_Graph.animScaleBySeries ( bool  isPoint,
float  duration,
float  delay,
Ease  anEaseType,
List< Vector3 >  before,
List< Vector3 >  after 
)

Animate all the points in a single series simultaneously, and then proceed to the next series.

Parameters
isPointIf set to true is point.
durationDuration.
delayDelay.
anEaseTypeAn ease type.
beforeBefore.
afterAfter.

◆ animScaleOneByOne()

void WMG_Axis_Graph.animScaleOneByOne ( bool  isPoint,
float  duration,
float  delay,
Ease  anEaseType,
List< Vector3 >  before,
List< Vector3 >  after,
int  loopDir 
)

Animate the points across multiple series simultaneously, and then proceed to the next points.

Parameters
isPointIf set to true is point.
durationDuration.
delayDelay.
anEaseTypeAn ease type.
beforeBefore.
afterAfter.
loopDirLoop dir.

◆ aSeriesPointsChanged()

void WMG_Axis_Graph.aSeriesPointsChanged ( )

Happens when a series points changed, this should not be used outside of Graph Maker code.

◆ changeAllLinePivots()

void WMG_Axis_Graph.changeAllLinePivots ( WMGpivotTypes  newPivot)

◆ deleteSeries()

void WMG_Axis_Graph.deleteSeries ( )

Delete the last series.

◆ deleteSeriesAt()

void WMG_Axis_Graph.deleteSeriesAt ( int  index)

Delete a series at the specified index.

Parameters
indexIndex.

◆ getDistBetween()

float WMG_Axis_Graph.getDistBetween ( int  pointsCount,
float  theAxisLength 
)

◆ getMaxNumPoints()

int WMG_Axis_Graph.getMaxNumPoints ( )

The max number of points across all series.

Returns
The max number points.

◆ getMaxPointSize()

float WMG_Axis_Graph.getMaxPointSize ( )

◆ getMaxSeriesBarCount()

int WMG_Axis_Graph.getMaxSeriesBarCount ( )

The max number of bars across all series.

Returns
The max series bar count.

◆ getSeriesScaleVectors()

List<Vector3> WMG_Axis_Graph.getSeriesScaleVectors ( bool  useLineWidthForX,
float  x,
float  y 
)

◆ getXAxisLabels()

List<WMG_Node> WMG_Axis_Graph.getXAxisLabels ( )

Obsolete.

◆ getXAxisTicks()

List<WMG_Node> WMG_Axis_Graph.getXAxisTicks ( )

Obsolete.

◆ getYAxisLabels()

List<WMG_Node> WMG_Axis_Graph.getYAxisLabels ( )

Obsolete.

◆ getYAxisTicks()

List<WMG_Node> WMG_Axis_Graph.getYAxisTicks ( )

Obsolete.

◆ GraphBackgroundChangedHandler()

delegate void WMG_Axis_Graph.GraphBackgroundChangedHandler ( WMG_Axis_Graph  aGraph)

◆ GraphChanged()

void WMG_Axis_Graph.GraphChanged ( )

Happens when various elements of the graph has changed, this should not be used outside of Graph Maker code.

◆ InEditorUpdate()

void WMG_Axis_Graph.InEditorUpdate ( )

Update called from Editor window, should not be used outside of Graph Maker code.

◆ Init()

void WMG_Axis_Graph.Init ( )

Initializes the graph, and should always be done before anything else, called automatically in Start(), but it never hurts to call this manually after instantiating a graph prefab.

◆ ManualResize()

void WMG_Axis_Graph.ManualResize ( )

Useful if resizeEnabled = false, and you want to resize graph content manually by calling this when you want.

◆ NumComboBarSeries()

int WMG_Axis_Graph.NumComboBarSeries ( )

The number of series that are combo bar series.

◆ OnGraphBackgroundChanged()

virtual void WMG_Axis_Graph.OnGraphBackgroundChanged ( )
protectedvirtual

◆ Refresh()

void WMG_Axis_Graph.Refresh ( )

Refreshes the graph, and happens automatically in Update(), but sometimes it is useful or necessary to call this manually, note that refresh updates only the parts of the graph affected by properties that have changed since a last refresh.

◆ SeriesChanged()

void WMG_Axis_Graph.SeriesChanged ( bool  countChanged,
bool  instant 
)

Happens when a series points changed, this should not be used outside of Graph Maker code.

Parameters
countChangedIf set to true count changed.
instantIf set to true instant.

◆ setOriginalPropertyValues()

void WMG_Axis_Graph.setOriginalPropertyValues ( )

Caches initial property values that are used as the basis for resizeEnabled functionality.

◆ UpdateOrientation()

void WMG_Axis_Graph.UpdateOrientation ( )

Updates the graph orientation, this should not be used outside of Graph Maker code.

Member Data Documentation

◆ anchoredParent

GameObject WMG_Axis_Graph.anchoredParent

A GameObject similar to the Graph Background object, but whose child objects use anchoring to position such as the legend.

◆ autoAnimationsDuration

float WMG_Axis_Graph.autoAnimationsDuration

The duration of the auto animations.

◆ autoAnimationsEasetype

Ease WMG_Axis_Graph.autoAnimationsEasetype

The auto animations easetype.

◆ autoPaddingC

WMG_Change_Obj WMG_Axis_Graph.autoPaddingC = new WMG_Change_Obj()

◆ barPrefab

Object WMG_Axis_Graph.barPrefab

For bar graphs, this is the prefab used in drawing the bars for all series.

◆ graphAreaBoundsParent

GameObject WMG_Axis_Graph.graphAreaBoundsParent

A GameObject whose RectTransform defines the bounding box formed by the graph's axes.

◆ graphBackground

GameObject WMG_Axis_Graph.graphBackground

The graph background.

◆ graphC

WMG_Change_Obj WMG_Axis_Graph.graphC = new WMG_Change_Obj()

◆ graphTitle

GameObject WMG_Axis_Graph.graphTitle

The graph title.

◆ groups

WMG_List<string> WMG_Axis_Graph.groups = new WMG_List<string>()

The list of groups used, see useGroups for info about groups.

◆ legend

WMG_Legend WMG_Axis_Graph.legend

The legend.

◆ lineSeries

List<GameObject> WMG_Axis_Graph.lineSeries

The list of series for this graph, it is a GameObject list, but each GameObject must have a WMG_Series.

◆ linkPrefabs

List<Object> WMG_Axis_Graph.linkPrefabs

The list of line series line prefabs to which WMG_Series::linkPrefab corresponds, for which a value of 0 will mean to use the first prefab in this list.

◆ pointPrefabs

List<Object> WMG_Axis_Graph.pointPrefabs

The list of line series point prefabs to which WMG_Series::pointPrefab corresponds, for which a value of 0 will mean to use the first prefab in this list.

◆ resizingChangesFontScaleInsteadOfFontSize

bool WMG_Axis_Graph.resizingChangesFontScaleInsteadOfFontSize = false

When resizeEnabled = true, the resizing process for Text objects will change the objects scale instead of font size when this is true.

◆ seriesCountC

WMG_Change_Obj WMG_Axis_Graph.seriesCountC = new WMG_Change_Obj()

◆ seriesNoCountC

WMG_Change_Obj WMG_Axis_Graph.seriesNoCountC = new WMG_Change_Obj()

◆ seriesParent

GameObject WMG_Axis_Graph.seriesParent

The WMG_Series objects have this as their parent.

◆ seriesPrefab

Object WMG_Axis_Graph.seriesPrefab

Dynamically adding series with addSeries or addSeriesAt functions will use this prefab to create the new series.

◆ theTooltip

WMG_Graph_Tooltip WMG_Axis_Graph.theTooltip

The tooltip.

◆ tooltipAnimationsDuration

float WMG_Axis_Graph.tooltipAnimationsDuration

The duration of the tooltip animations.

◆ tooltipAnimationsEasetype

Ease WMG_Axis_Graph.tooltipAnimationsEasetype

The tooltip animations easetype.

◆ tooltipAnimationsEnabled

bool WMG_Axis_Graph.tooltipAnimationsEnabled

Whether or not an animation plays (e.g.

size change of data point) when hovering mouse over a data point for tooltips.

◆ tooltipDisplaySeriesName

bool WMG_Axis_Graph.tooltipDisplaySeriesName

Whether or not the tooltip also displays the WMG_Series::seriesName to the left of the data in the tooltip.

◆ toolTipLabel

GameObject WMG_Axis_Graph.toolTipLabel

The tool tip label.

◆ tooltipNumberDecimals

int WMG_Axis_Graph.tooltipNumberDecimals

The numbr of decimals used when data is displayed in the tooltip.

◆ tooltipOffset

Vector2 WMG_Axis_Graph.tooltipOffset

The positional offset from the bottom left corner of the tooltip from the mouse cursor.

◆ toolTipPanel

GameObject WMG_Axis_Graph.toolTipPanel

The tool tip panel / parent.

◆ xAxis

WMG_Axis WMG_Axis_Graph.xAxis

The x axis.

◆ yAxis

WMG_Axis WMG_Axis_Graph.yAxis

The y axis.

◆ yAxis2

WMG_Axis WMG_Axis_Graph.yAxis2

The secondary y axis when axesType = DUAL_Y.

Property Documentation

◆ autoAnimationsEnabled

bool WMG_Axis_Graph.autoAnimationsEnabled
getset

When enabled, certain changes will automatically play an animation such as a data point changing its y-value, or the graph orientation changing.

Adding or removing data points from a series does not play an animation, it is recommended to disable this and code your own animation as is done in the X_Plot_Overtime example.

true if auto animations enabled; otherwise, false.

◆ autoFitLabels

bool WMG_Axis_Graph.autoFitLabels
getset

Obsolete.

◆ autoFitPadding

float WMG_Axis_Graph.autoFitPadding
getset

Obsolete.

◆ autoGrowAndShrinkByPercent

float WMG_Axis_Graph.autoGrowAndShrinkByPercent
getset

When WMG_Axis::MinAutoShrink = true, WMG_Axis::MaxAutoShrink = true, WMG_Axis::MinAutoGrow = true, or WMG_Axis::MaxAutoGrow = true, determines the amount of an auto shrink / growth.

For example, if the y axis min is 0 and max is 100, and there exists series data that is above 100, and this parameter is 0.2 (20%), then the new max would be 120.

The auto grow and shrink by percent.

◆ autoPaddingAmount

float WMG_Axis_Graph.autoPaddingAmount
getset

This is the amount of padding space between the graph content and graph boundary that is used when autoPaddingEnabled = true.

The auto padding amount.

◆ autoPaddingEnabled

bool WMG_Axis_Graph.autoPaddingEnabled
getset

When enabled, automatically sets paddingLeftRight and paddingTopBottom based on autoPaddingProperties and autoPaddingAmount.

This is primarily useful to ensure axis labels do not exceed the border of the graph boundaries determined by the rectTransform's width / height of the graph.

true if auto padding enabled; otherwise, false.

◆ autoPaddingProperties

AutoPaddingProperties WMG_Axis_Graph.autoPaddingProperties
getset

The elements of graph content that is taken into consideration when autoPaddingEnabled = true.

Axis labels, ticks, arrows, and lines are all automatically considered, and thus cannot / do not need to be specified here. This is for specifiying additional graph features which you may or may not want to include, for example you would specify legend here if you want the legend to be within the graph boundary, and the graph padding to be updated automatically according to the size of the legend.

The auto padding properties.

◆ autoShrinkAtPercent

float WMG_Axis_Graph.autoShrinkAtPercent
getset

When WMG_Axis::MinAutoShrink = true or WMG_Axis::MaxAutoShrink = true, determines percentage threshold at which an auto shrink occurs.

It is a percentage of the total axis length. For example, if the y axis min is 0 and the max is 100, and this is 0.6 (60%), then a shrink will occur if all y-axis data for all WMG_Series is below 60.

The auto shrink at percent.

◆ autoUpdateBarAxisValue

bool WMG_Axis_Graph.autoUpdateBarAxisValue
getset

When enabled, automatically updates barAxisValue based on the theOrigin.

true if auto update bar axis value; otherwise, false.

◆ autoUpdateBarWidth

bool WMG_Axis_Graph.autoUpdateBarWidth
getset

When enabled, automatically updates barWidth based on autoUpdateBarWidthSpacing.

Useful to ensure bars don't overlap when dynamically adding series by reducing the bar width as needed.

true if auto update bar width; otherwise, false.

◆ autoUpdateBarWidthSpacing

float WMG_Axis_Graph.autoUpdateBarWidthSpacing
getset

When autoUpdateBarWidth = true, automatically updates barWidth based on this specified percentage of the graph's axis length.

This ensures the total amount of space not occupied by bars is equal to this percent. For example at 0.3, 30% of the space occupied by bars is empty space.

The auto update bar width spacing.

◆ autoUpdateOrigin

bool WMG_Axis_Graph.autoUpdateOrigin
getset

When enabled, automatically sets theOrigin based on axesType.

For example, if axes type is quadrant I, and the min X axis value is -100, and min Y value is 50, then the origin will be (-100, 50). Does not do anything if axesType is of an AUTO_ORIGIN type.

true if auto update origin; otherwise, false.

◆ autoUpdateSeriesAxisSpacing

bool WMG_Axis_Graph.autoUpdateSeriesAxisSpacing
getset

When enabled, automatically updates WMG_Series::extraXSpace, which is the padding of space for the series from the axis line.

For example for non-stacked bar charts with multiple series, the later series will have a higher spacing such that they appear to the right of the previous series.

true if auto update series axis spacing; otherwise, false.

◆ axesType

axesTypes WMG_Axis_Graph.axesType
getset

Determines how axes are oriented, the roman numerals refer to quadrants where quadrant 1 is the top right, and quadrant 4 is bottom right.

  • Manual: Graph Maker will not do anything with regards to moving around the axes.
  • Center: Equivalent to all four quadrants or axes positioned in the center.
  • DUAL_Y: Use for dual y-axis charts, in this case WMG_Series::useSecondYaxis for each series should be set.
  • AUTO_ORIGIN: Automatically positions axes closest to the theOrigin. In this case changing Axis min / max values will automatically reposition the axes. When this option is set, it is also recommended to set WMG_Axis::AxisUseNonTickPercent = true, so that the axes reposition freely instead of stay fixed to axis ticks.
  • AUTO_ORIGIN_X: Automatically positions only the X-axis closest to the theOrigin.
  • AUTO_ORIGIN_Y: Automatically positions only the Y-axis closest to the theOrigin.

The type of the axes.

◆ axisWidth

int WMG_Axis_Graph.axisWidth
getset

Determines the width of the x / y axis lines.

The width of the axes.

◆ barAxisValue

float WMG_Axis_Graph.barAxisValue
getset

Controls the starting point for bar charts.

For example, if the y-axis min is 0 and y-axis max is 20, and this is set to 10, then the base of the bars will start from 10 and either go up or down depending on the data set for each bar. So, a bar representing a value of 5 will start from 10 and go downwards to 5, and a bar with a value of 15 will start from 10 and go upwards to 15.

The bar axis value.

◆ barWidth

float WMG_Axis_Graph.barWidth
getset

Determines the width of the series' bars for bar graphs.

This is specified here instead of the series, since bar width cannot vary between series. Series point sizing can be specified for each series using WMG_Series::pointWidthHeight.

◆ graphTitleOffset

Vector2 WMG_Axis_Graph.graphTitleOffset
getset

The positional offset of graphTitleString used to control how much space there is between the graph title and the graph.

The graph title offset.

◆ graphTitleSize

int WMG_Axis_Graph.graphTitleSize
getset

The font size of graphTitleString.

The size of the graph title.

◆ graphTitleString

string WMG_Axis_Graph.graphTitleString
getset

The string to display for the title of the graph, which appears at the top of the graph.

The graph title string.

◆ graphType

graphTypes WMG_Axis_Graph.graphType
getset

Gets or sets the type of the graph, which determines at a high level how data will be displayed.

The type of the graph.

◆ IsStacked

bool WMG_Axis_Graph.IsStacked
get

◆ orientationType

orientationTypes WMG_Axis_Graph.orientationType
getset

Gets or sets the type of the orientation, where vertical means the y-axis data will be displayed vertically.

The type of the orientation.

◆ paddingLeftRight

Vector2 WMG_Axis_Graph.paddingLeftRight
getset

The amount of space on the left / right sides of the graph content formed by bounding box of the axis lines, and set automatically if autoPaddingEnabled = true.

The padding left right.

◆ paddingTopBottom

Vector2 WMG_Axis_Graph.paddingTopBottom
getset

The amount of space on the top / bottom sides of the graph content formed by bounding box of the axis lines, and set automatically if autoPaddingEnabled = true.

The padding top bottom.

◆ resizeEnabled

bool WMG_Axis_Graph.resizeEnabled
getset

Determines whether graph content (resizeProperties) will resize post graph initialization based on the percentage change of the graph's rect transform width / height.

true if resize enabled; otherwise, false.

◆ resizeProperties

ResizeProperties WMG_Axis_Graph.resizeProperties
getset

Specifies which graph content is resized when resizeEnabled = true.

The resize properties.

◆ theOrigin

Vector2 WMG_Axis_Graph.theOrigin
getset

The origin of the graph, affects position of axes if axesType is of an AUTO_ORIGIN type, also affects barAxisValue if autoUpdateBarAxisValue = true.

The origin.

◆ tickSize

Vector2 WMG_Axis_Graph.tickSize
getset

Determines the width and height of axis ticks, for which there are WMG_Axis::AxisNumTicks if WMG_Axis::hideTicks = false.

The size of the tick.

◆ tooltipEnabled

bool WMG_Axis_Graph.tooltipEnabled
getset

Determines whether to show a tooltip when the mouse hovers over a series data point / bar.

true if tooltip enabled; otherwise, false.

◆ TotalPointValues

List<float> WMG_Axis_Graph.TotalPointValues
get

Contains the summed values for series' data, used for stacked charts.

The total point values.

◆ useGroups

bool WMG_Axis_Graph.useGroups
getset

Determines whether the data for each series corresponds to an element in groups, where the (group index + 1) corresponds with WMG_Series::pointValues x value.

This option is useful to display axes labels that correspond with data points rather than axis ticks (WMG_Axis::LabelType = groups). For example, you could have 12 groups that represents months of the year, and series data that corresponds to each month. You could also have a large number of groups like 365 days of the year and use WMG_Axis::AxisLabelSkipInterval to not clutter the axis with labels. Additionally, you can use this option to graph NULLs. For example, if you have 12 month groups, but one or more of your series does not have data for March, then you can pass in a negative number to represent NULL (e.g. (-3, 0) for March). Remember it is (group index + 1) so January is 1, and December is 12.

true if use groups; otherwise, false.

◆ xAxisLength

float WMG_Axis_Graph.xAxisLength
get

◆ xAxisLengthOrienInd

float WMG_Axis_Graph.xAxisLengthOrienInd
get

◆ yAxisLength

float WMG_Axis_Graph.yAxisLength
get

◆ yAxisLengthOrienInd

float WMG_Axis_Graph.yAxisLengthOrienInd
get

Event Documentation

◆ GraphBackgroundChanged

GraphBackgroundChangedHandler WMG_Axis_Graph.GraphBackgroundChanged

The documentation for this class was generated from the following file: