Search Results for

Show / Hide Table of Contents

# Class GraphView

Control for rendering graphs (bar, scatter etc)

##### Inheritance

System.Object
Responder
View
GraphView

##### Implements

System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize

##### Inherited Members

View.Added
View.Removed
View.Enter
View.Leave
View.MouseEnter
View.MouseLeave
View.MouseClick
View.HotKey
View.HotKeySpecifier
View.Shortcut
View.ShortcutTag
View.ShortcutAction
View.Data
View.Driver
View.Subviews
View.TabIndexes
View.TabIndex
View.TabStop
View.CanFocus
View.Id
View.IsCurrentTop
View.WantMousePositionReports
View.WantContinuousButtonPressed
View.Frame
View.LayoutStyle
View.Bounds
View.X
View.Y
View.Width
View.Height
View.SuperView
View.SetNeedsDisplay()
View.ClearLayoutNeeded()
View.SetNeedsDisplay(Rect)
View.SetChildNeedsDisplay()
View.Add(View)
View.Add(View[])
View.RemoveAll()
View.Remove(View)
View.BringSubviewToFront(View)
View.SendSubviewToBack(View)
View.SendSubviewBackwards(View)
View.BringSubviewForward(View)
View.Clear()
View.Clear(Rect)
View.ScreenToView(Int32, Int32)
View.ClipToBounds()
View.SetClip(Rect)
View.DrawFrame(Rect, Int32, Boolean)
View.DrawHotString(ustring, Attribute, Attribute)
View.DrawHotString(ustring, Boolean, ColorScheme)
View.Move(Int32, Int32)
View.PositionCursor()
View.HasFocus
View.OnAdded(View)
View.OnRemoved(View)
View.OnEnter(View)
View.OnLeave(View)
View.Focused
View.MostFocused
View.ColorScheme
View.AddRune(Int32, Int32, Rune)
View.ClearNeedsDisplay()
View.DrawContent
View.OnDrawContent(Rect)
View.SetFocus()
View.KeyPress
View.ProcessHotKey(KeyEvent)
View.ProcessColdKey(KeyEvent)
View.KeyDown
View.OnKeyDown(KeyEvent)
View.KeyUp
View.OnKeyUp(KeyEvent)
View.EnsureFocus()
View.FocusFirst()
View.FocusLast()
View.FocusPrev()
View.FocusNext()
View.LayoutStarted
View.LayoutComplete
View.Initialized
View.LayoutSubviews()
View.Text
View.AutoSize
View.TextAlignment
View.VerticalTextAlignment
View.TextDirection
View.IsInitialized
View.ToString()
View.OnMouseEnter(MouseEvent)
View.OnMouseLeave(MouseEvent)
View.OnMouseEvent(MouseEvent)
View.OnMouseClick(View.MouseEventArgs)
View.Dispose(Boolean)
View.BeginInit()
View.EndInit()
View.Visible
View.SetWidth(Int32, Int32)
View.SetHeight(Int32, Int32)
View.GetCurrentWidth(Int32)
View.GetCurrentHeight(Int32)
Responder.MouseEvent(MouseEvent)
Responder.Dispose()
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)

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class GraphView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize

### Constructors

#### GraphView()

Creates a new graph with a 1 to 1 graph space with absolute layout

##### Declaration

    public GraphView()

### Properties

#### Annotations

Elements drawn into graph after series have been drawn e.g. Legends etc

##### Declaration

    public List<IAnnotation> Annotations { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.List<IAnnotation> |

#### AxisX

Horizontal axis

##### Declaration

    public HorizontalAxis AxisX { get; set; }

##### Property Value

Type | Description
--- | ---
HorizontalAxis |

#### AxisY

Vertical axis

##### Declaration

    public VerticalAxis AxisY { get; set; }

##### Property Value

Type | Description
--- | ---
VerticalAxis |

#### CellSize

Translates console width/height into graph space. Defaults to 1 row/col of console space being 1 unit of graph space.

##### Declaration

    public PointF CellSize { get; set; }

##### Property Value

Type | Description
--- | ---
PointF |

#### GraphColor

The color of the background of the graph and axis/labels

##### Declaration

    public Attribute? GraphColor { get; set; }

##### Property Value

Type | Description
--- | ---
System.Nullable<Attribute> |

#### MarginBottom

Amount of space to leave on bottom of control. Graph content (Series) will not be rendered in margins but axis labels may be

##### Declaration

    public uint MarginBottom { get; set; }

##### Property Value

Type | Description
--- | ---
System.UInt32 |

#### MarginLeft

Amount of space to leave on left of control. Graph content (Series) will not be rendered in margins but axis labels may be

##### Declaration

    public uint MarginLeft { get; set; }

##### Property Value

Type | Description
--- | ---
System.UInt32 |

#### ScrollOffset

The graph space position of the bottom left of the control. Changing this scrolls the viewport around in the graph

##### Declaration

    public PointF ScrollOffset { get; set; }

##### Property Value

Type | Description
--- | ---
PointF |

#### Series

Collection of data series that are rendered in the graph

##### Declaration

    public List<ISeries> Series { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.List<ISeries> |

### Methods

#### DrawLine(Point, Point, Rune)

Draws a line between two points in screen space. Can be diagonals.

##### Declaration

    public void DrawLine(Point start, Point end, Rune symbol)

##### Parameters

Type | Name | Description
--- | --- | ---
Point | start |
Point | end |
System.Rune | symbol | The symbol to use for the line

#### GraphSpaceToScreen(PointF)

Calculates the screen location for a given point in graph space. Bear in mind these be off screen

##### Declaration

    public Point GraphSpaceToScreen(PointF location)

##### Parameters

Type | Name | Description
--- | --- | ---
PointF | location | Point in graph space that may or may not be represented in the visible area of graph currently presented. E.g. 0,0 for origin

##### Returns

Type | Description
--- | ---
Point | Screen position (Column/Row) which would be used to render the graph `location`. Note that this can be outside the current client area of the control

#### ProcessKey(KeyEvent)

##### Declaration

    public override bool ProcessKey(KeyEvent keyEvent)

##### Parameters

Type | Name | Description
--- | --- | ---
KeyEvent | keyEvent |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

View.ProcessKey(KeyEvent)

#### Redraw(Rect)

##### Declaration

    public override void Redraw(Rect bounds)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | bounds |

##### Overrides

View.Redraw(Rect)

#### Reset()

Clears all settings configured on the graph and resets all properties to default values (CellSize, ScrollOffset etc)

##### Declaration

    public void Reset()

#### ScreenToGraphSpace(Int32, Int32)

Returns the section of the graph that is represented by the given screen position

##### Declaration

    public RectangleF ScreenToGraphSpace(int col, int row)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | col |
System.Int32 | row |

##### Returns

Type | Description
--- | ---
RectangleF |

#### ScreenToGraphSpace(Rect)

Returns the section of the graph that is represented by the screen area

##### Declaration

    public RectangleF ScreenToGraphSpace(Rect screenArea)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | screenArea |

##### Returns

Type | Description
--- | ---
RectangleF |

#### SetDriverColorToGraphColor()

Sets the color attribute of Driver to the GraphColor (if defined) or ColorScheme otherwise.

##### Declaration

    public void SetDriverColorToGraphColor()

### Implements

System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize