Class LegendAnnotation
A box containing symbol definitions e.g. meanings for colors in a graph.
The 'Key' to the graph
Inheritance
System.Object
LegendAnnotation
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Terminal.Gui.Graphs
Assembly: Terminal.Gui.dll
Syntax
public class LegendAnnotation : IAnnotation
Constructors
LegendAnnotation(Rect)
Creates a new empty legend at the given screen coordinates
Declaration
public LegendAnnotation(Rect legendBounds)
Parameters
Type | Name | Description |
---|---|---|
Rect | legendBounds | Defines the area available for the legend to render in (within the graph). This is in screen units (i.e. not graph space) |
Properties
BeforeSeries
Returns false i.e. Lengends render after series
Declaration
public bool BeforeSeries { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Border
True to draw a solid border around the legend.
Defaults to true. This border will be within the
Bounds and so reduces the width/height
available for text by 2
Declaration
public bool Border { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Bounds
Defines the screen area available for the legend to render in
Declaration
public Rect Bounds { get; set; }
Property Value
Type | Description |
---|---|
Rect |
Methods
AddEntry(GraphCellToRender, String)
Adds an entry into the legend. Duplicate entries are permissable
Declaration
public void AddEntry(GraphCellToRender graphCellToRender, string text)
Parameters
Type | Name | Description |
---|---|---|
GraphCellToRender | graphCellToRender | The symbol appearing on the graph that should appear in the legend |
System.String | text | Text to render on this line of the legend. Will be truncated if outside of Legend Bounds |
Render(GraphView)
Draws the Legend and all entries into the area within Bounds
Declaration
public void Render(GraphView graph)
Parameters
Type | Name | Description |
---|---|---|
GraphView | graph |