Graph Maker
WMG_Legend Class Reference

The legend used for pie graphs and axis graphs. More...

Inheritance diagram for WMG_Legend:
WMG_GUI_Functions WMG_Text_Functions

Public Types

enum  legendTypes { legendTypes.Bottom, legendTypes.Right }
 
- 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

void Init ()
 Initializes the legend, done during graph initialization. More...
 
void PauseCallbacks ()
 Used during Graph refresh process, should not be called outside of Graph Maker code. More...
 
void ResumeCallbacks ()
 Used during Graph refresh process, should not be called outside of Graph Maker code. More...
 
void setOriginalPropertyValues ()
 Sets original property values, used for resizing purposes, called during initialization. More...
 
WMG_Legend_Entry createLegendEntry (Object prefab)
 Creates a legend entry, used in pie graphs. More...
 
WMG_Legend_Entry createLegendEntry (Object prefab, WMG_Series series, int index)
 Creates a legend entry, used in axis graphs. More...
 
void deleteLegendEntry (int index)
 
void updateLegend ()
 Refreshes the legend. More...
 
void setLabelScales (float newScale)
 
- 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_Graph_Manager theGraph
 Reference to the graph of this legend. More...
 
GameObject background
 The background. More...
 
GameObject entriesParent
 The entries parent. More...
 
Object emptyPrefab
 An empty node prefab used to connect lines to nodes in line series legend entries. More...
 
List< WMG_Legend_EntrylegendEntries
 The legend entries. More...
 
WMG_Change_Obj legendC = new WMG_Change_Obj()
 

Properties

bool hideLegend [get, set]
 Controls whether the legend is displayed. More...
 
legendTypes legendType [get, set]
 Controls whether the legend is displayed along top / bottom or right / left. More...
 
WMG_Enums.labelTypes labelType [get, set]
 Controls how the labels appear for the legend entries. More...
 
bool showBackground [get, set]
 Controls whether the legend background sprite appears. More...
 
bool oppositeSideLegend [get, set]
 Moves legend to the other side, so from bot to top, or right to left. More...
 
float offset [get, set]
 Controls how far the legend is positionally offset from the graph. More...
 
float legendEntryWidth [get, set]
 The width of each legend entry, can be set automatically if setWidthFromLabels = true. More...
 
bool setWidthFromLabels [get, set]
 Automatically update legendEntryWidth based on the width of legend entry labels. More...
 
float legendEntryHeight [get, set]
 The height of legend entries. More...
 
int numRowsOrColumns [get, set]
 Controls how many rows will appear for horizontal legends, and how many columns will appear for vertical legends. More...
 
int numDecimals [get, set]
 The number of decimals used to display in text values for legend entries, used in pie graphs. More...
 
float legendEntryLinkSpacing [get, set]
 For line series, this is length of each of the lines appearing on the sides of the point in the legend entry. More...
 
int legendEntryFontSize [get, set]
 The font size of legend entry text objects. More...
 
float legendEntrySpacing [get, set]
 Controls the spacing between the swatch and the text for the legend entries. More...
 
float pieSwatchSize [get, set]
 Controls the size of the colored swatches for pie graph legends. More...
 
float backgroundPadding [get, set]
 The amount of space padded between the legend entries and the legend background. More...
 
bool autofitEnabled [get, set]
 Automatically updates numRowsOrColumns to best fit the graph's width / height. More...
 
Color labelColor [get, set]
 Gets or sets the color of the labels in the legend entries. More...
 
FontStyle legendEntryFontStyle [get, set]
 Gets or sets the legend entry font style. More...
 
Font legendEntryFont [get, set]
 Gets or sets the legend entry font. More...
 
int LegendWidth [get]
 Gets the total width of the legend. More...
 
int LegendHeight [get]
 Gets the total height of the legend. More...
 
int NumEntries [get]
 Gets the number entries in the legend. More...
 
int MaxInRowOrColumn [get]
 Gets the maximum number of legend entries in row or column. More...
 
float origLegendEntryWidth [get]
 
float origLegendEntryHeight [get]
 
float origLegendEntryLinkSpacing [get]
 
int origLegendEntryFontSize [get]
 
float origLegendEntrySpacing [get]
 
float origPieSwatchSize [get]
 
float origOffset [get]
 
float origBackgroundPadding [get]
 

Detailed Description

The legend used for pie graphs and axis graphs.

Member Enumeration Documentation

◆ legendTypes

Enumerator
Bottom 
Right 

Member Function Documentation

◆ createLegendEntry() [1/2]

WMG_Legend_Entry WMG_Legend.createLegendEntry ( Object  prefab)

Creates a legend entry, used in pie graphs.

Returns
The legend entry.
Parameters
prefabPrefab.

◆ createLegendEntry() [2/2]

WMG_Legend_Entry WMG_Legend.createLegendEntry ( Object  prefab,
WMG_Series  series,
int  index 
)

Creates a legend entry, used in axis graphs.

Returns
The legend entry.
Parameters
prefabPrefab.
seriesSeries.
indexIndex.

◆ deleteLegendEntry()

void WMG_Legend.deleteLegendEntry ( int  index)

◆ Init()

void WMG_Legend.Init ( )

Initializes the legend, done during graph initialization.

◆ PauseCallbacks()

void WMG_Legend.PauseCallbacks ( )

Used during Graph refresh process, should not be called outside of Graph Maker code.

◆ ResumeCallbacks()

void WMG_Legend.ResumeCallbacks ( )

Used during Graph refresh process, should not be called outside of Graph Maker code.

◆ setLabelScales()

void WMG_Legend.setLabelScales ( float  newScale)

◆ setOriginalPropertyValues()

void WMG_Legend.setOriginalPropertyValues ( )

Sets original property values, used for resizing purposes, called during initialization.

◆ updateLegend()

void WMG_Legend.updateLegend ( )

Refreshes the legend.

Member Data Documentation

◆ background

GameObject WMG_Legend.background

The background.

◆ emptyPrefab

Object WMG_Legend.emptyPrefab

An empty node prefab used to connect lines to nodes in line series legend entries.

◆ entriesParent

GameObject WMG_Legend.entriesParent

The entries parent.

◆ legendC

WMG_Change_Obj WMG_Legend.legendC = new WMG_Change_Obj()

◆ legendEntries

List<WMG_Legend_Entry> WMG_Legend.legendEntries

The legend entries.

◆ theGraph

WMG_Graph_Manager WMG_Legend.theGraph

Reference to the graph of this legend.

Property Documentation

◆ autofitEnabled

bool WMG_Legend.autofitEnabled
getset

Automatically updates numRowsOrColumns to best fit the graph's width / height.

true if autofit enabled; otherwise, false.

◆ backgroundPadding

float WMG_Legend.backgroundPadding
getset

The amount of space padded between the legend entries and the legend background.

The background padding.

◆ hideLegend

bool WMG_Legend.hideLegend
getset

Controls whether the legend is displayed.

true if hide legend; otherwise, false.

◆ labelColor

Color WMG_Legend.labelColor
getset

Gets or sets the color of the labels in the legend entries.

The color of the label.

◆ labelType

WMG_Enums.labelTypes WMG_Legend.labelType
getset

Controls how the labels appear for the legend entries.

The type of the label.

◆ legendEntryFont

Font WMG_Legend.legendEntryFont
getset

Gets or sets the legend entry font.

The legend entry font.

◆ legendEntryFontSize

int WMG_Legend.legendEntryFontSize
getset

The font size of legend entry text objects.

The size of the legend entry font.

◆ legendEntryFontStyle

FontStyle WMG_Legend.legendEntryFontStyle
getset

Gets or sets the legend entry font style.

The legend entry font style.

◆ legendEntryHeight

float WMG_Legend.legendEntryHeight
getset

The height of legend entries.

The height of the legend entry.

◆ legendEntryLinkSpacing

float WMG_Legend.legendEntryLinkSpacing
getset

For line series, this is length of each of the lines appearing on the sides of the point in the legend entry.

The legend entry link spacing.

◆ legendEntrySpacing

float WMG_Legend.legendEntrySpacing
getset

Controls the spacing between the swatch and the text for the legend entries.

The legend entry spacing.

◆ legendEntryWidth

float WMG_Legend.legendEntryWidth
getset

The width of each legend entry, can be set automatically if setWidthFromLabels = true.

The width of the legend entry.

◆ LegendHeight

int WMG_Legend.LegendHeight
get

Gets the total height of the legend.

The height of the legend.

◆ legendType

legendTypes WMG_Legend.legendType
getset

Controls whether the legend is displayed along top / bottom or right / left.

The type of the legend.

◆ LegendWidth

int WMG_Legend.LegendWidth
get

Gets the total width of the legend.

The width of the legend.

◆ MaxInRowOrColumn

int WMG_Legend.MaxInRowOrColumn
get

Gets the maximum number of legend entries in row or column.

The max in row or column.

◆ numDecimals

int WMG_Legend.numDecimals
getset

The number of decimals used to display in text values for legend entries, used in pie graphs.

The number decimals.

◆ NumEntries

int WMG_Legend.NumEntries
get

Gets the number entries in the legend.

The number entries.

◆ numRowsOrColumns

int WMG_Legend.numRowsOrColumns
getset

Controls how many rows will appear for horizontal legends, and how many columns will appear for vertical legends.

If the number of series does not divide evenly into the number of rows / columns, then the first row(s) / column(s) will have the extras. For example, for a horizontal legend, if there are 10 series, and this is set to 4, then the first 2 rows will have 3, and the second 2 rows will have 2.

The number rows or columns.

◆ offset

float WMG_Legend.offset
getset

Controls how far the legend is positionally offset from the graph.

The offset.

◆ oppositeSideLegend

bool WMG_Legend.oppositeSideLegend
getset

Moves legend to the other side, so from bot to top, or right to left.

true if opposite side legend; otherwise, false.

◆ origBackgroundPadding

float WMG_Legend.origBackgroundPadding
get

◆ origLegendEntryFontSize

int WMG_Legend.origLegendEntryFontSize
get

◆ origLegendEntryHeight

float WMG_Legend.origLegendEntryHeight
get

◆ origLegendEntryLinkSpacing

float WMG_Legend.origLegendEntryLinkSpacing
get

◆ origLegendEntrySpacing

float WMG_Legend.origLegendEntrySpacing
get

◆ origLegendEntryWidth

float WMG_Legend.origLegendEntryWidth
get

◆ origOffset

float WMG_Legend.origOffset
get

◆ origPieSwatchSize

float WMG_Legend.origPieSwatchSize
get

◆ pieSwatchSize

float WMG_Legend.pieSwatchSize
getset

Controls the size of the colored swatches for pie graph legends.

The size of the pie swatch.

◆ setWidthFromLabels

bool WMG_Legend.setWidthFromLabels
getset

Automatically update legendEntryWidth based on the width of legend entry labels.

true if set width from labels; otherwise, false.

◆ showBackground

bool WMG_Legend.showBackground
getset

Controls whether the legend background sprite appears.

true if show background; otherwise, false.


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