Search Results for

    Show / Hide Table of Contents

    Class GraphView

    Control for rendering graphs (bar, scatter etc)
    Inheritance
    object
    Responder
    View
    GraphView
    Implements
    IDisposable
    ISupportInitializeNotification
    ISupportInitialize
    Inherited Members
    View.Added
    View.Removed
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.MouseClick
    View.CanFocusChanged
    View.EnabledChanged
    View.VisibleChanged
    View.HotKeyChanged
    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.ForceValidatePosDim
    View.GetMinWidthHeight(out Size)
    View.SetMinWidthHeight()
    View.TextFormatter
    View.SuperView
    View.UpdateTextFormatterText()
    View.ProcessResizeView()
    View.SetNeedsDisplay()
    View.ClearLayoutNeeded()
    View.SetNeedsDisplay(Rect)
    View.SetChildNeedsDisplay()
    View.Add(View)
    View.Add(params 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(int, int)
    View.ClipToBounds()
    View.SetClip(Rect)
    View.DrawFrame(Rect, int, bool)
    View.DrawHotString(ustring, Attribute, Attribute)
    View.DrawHotString(ustring, bool, ColorScheme)
    View.Move(int, int, bool)
    View.PositionCursor()
    View.HasFocus
    View.OnAdded(View)
    View.OnRemoved(View)
    View.OnLeave(View)
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(int, int, Rune)
    View.ClearNeedsDisplay()
    View.DrawContent
    View.OnDrawContent(Rect)
    View.DrawContentComplete
    View.OnDrawContentComplete(Rect)
    View.SetFocus()
    View.KeyPress
    View.InvokeKeybindings(KeyEvent)
    View.AddKeyBinding(Key, params Command[])
    View.ReplaceKeyBinding(Key, Key)
    View.ContainsKeyBinding(Key)
    View.ClearKeybindings()
    View.ClearKeybinding(Key)
    View.ClearKeybinding(params Command[])
    View.AddCommand(Command, Func<bool?>)
    View.GetSupportedCommands()
    View.GetKeyFromCommand(params Command[])
    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.PreserveTrailingSpaces
    View.TextAlignment
    View.VerticalTextAlignment
    View.TextDirection
    View.IsInitialized
    View.IsAdded
    View.Enabled
    View.ClearOnVisibleFalse
    View.Visible
    View.Border
    View.IgnoreBorderPropertyOnRedraw
    View.ToString()
    View.GetAutoSize()
    View.GetHotKeySpecifierLength(bool)
    View.GetTextFormatterBoundsSize()
    View.GetBoundsTextFormatterSize()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    View.OnMouseEvent(MouseEvent)
    View.OnMouseClick(View.MouseEventArgs)
    View.OnCanFocusChanged()
    View.OnEnabledChanged()
    View.OnVisibleChanged()
    View.Dispose(bool)
    View.BeginInit()
    View.EndInit()
    View.SetWidth(int, out int)
    View.SetHeight(int, out int)
    View.GetCurrentWidth(out int)
    View.GetCurrentHeight(out int)
    View.GetNormalColor()
    View.GetFocusColor()
    View.GetHotNormalColor()
    View.GetTopSuperView()
    Responder.MouseEvent(MouseEvent)
    Responder.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class GraphView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize

    Constructors

    | Edit this page View Source

    GraphView()

    Creates a new graph with a 1 to 1 graph space with absolute layout
    Declaration
    public GraphView()

    Properties

    | Edit this page View Source

    Annotations

    Elements drawn into graph after series have been drawn e.g. Legends etc
    Declaration
    public List<IAnnotation> Annotations { get; }
    Property Value
    Type Description
    List<IAnnotation>
    | Edit this page View Source

    AxisX

    Horizontal axis
    Declaration
    public HorizontalAxis AxisX { get; set; }
    Property Value
    Type Description
    HorizontalAxis
    | Edit this page View Source

    AxisY

    Vertical axis
    Declaration
    public VerticalAxis AxisY { get; set; }
    Property Value
    Type Description
    VerticalAxis
    | Edit this page View Source

    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
    | Edit this page View Source

    GraphColor

    The color of the background of the graph and axis/labels
    Declaration
    public Attribute? GraphColor { get; set; }
    Property Value
    Type Description
    Attribute?
    | Edit this page View Source

    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
    uint
    | Edit this page View Source

    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
    uint
    | Edit this page View Source

    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
    | Edit this page View Source

    Series

    Collection of data series that are rendered in the graph
    Declaration
    public List<ISeries> Series { get; }
    Property Value
    Type Description
    List<ISeries>

    Methods

    | Edit this page View Source

    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
    Rune symbol The symbol to use for the line
    | Edit this page View Source

    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
    | Edit this page View Source

    OnEnter(View)

    Method invoked when a view gets focus.
    Declaration
    public override bool OnEnter(View view)
    Parameters
    Type Name Description
    View view The view that is losing focus.
    Returns
    Type Description
    bool true, if the event was handled, false otherwise.
    Overrides
    View.OnEnter(View)
    Remarks
    Also ensures that cursor is invisible after entering the GraphView.
    | Edit this page View Source

    PageDown()

    Scrolls the graph down 1 page
    Declaration
    public void PageDown()
    | Edit this page View Source

    PageUp()

    Scrolls the graph up 1 page
    Declaration
    public void PageUp()
    | Edit this page View Source

    ProcessKey(KeyEvent)

    If the view is focused, gives the view a chance to process the keystroke.
    Declaration
    public override bool ProcessKey(KeyEvent keyEvent)
    Parameters
    Type Name Description
    KeyEvent keyEvent Contains the details about the key that produced the event.
    Returns
    Type Description
    bool
    Overrides
    View.ProcessKey(KeyEvent)
    Remarks

    Views can override this method if they are interested in processing the given keystroke. If they consume the keystroke, they must return true to stop the keystroke from being processed by other widgets or consumed by the widget engine. If they return false, the keystroke will be passed using the ProcessColdKey method to other views to process.

    The View implementation does nothing but return false, so it is not necessary to call base.ProcessKey if you derive directly from View, but you should if you derive other View subclasses.

    | Edit this page View Source

    Redraw(Rect)

    Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
    Declaration
    public override void Redraw(Rect bounds)
    Parameters
    Type Name Description
    Rect bounds The bounds (view-relative region) to redraw.
    Overrides
    View.Redraw(Rect)
    Remarks

    Always use Bounds (view-relative) when calling Redraw(Rect), NOT Frame (superview-relative).

    Views should set the color that they want to use on entry, as otherwise this will inherit the last color that was set globally on the driver.

    Overrides of Redraw(Rect) must ensure they do not set Driver.Clip to a clip region larger than the parameter, as this will cause the driver to clip the entire region.

    | Edit this page View Source

    Reset()

    Clears all settings configured on the graph and resets all properties to default values (CellSize, ScrollOffset etc)
    Declaration
    public void Reset()
    | Edit this page View Source

    ScreenToGraphSpace(int, int)

    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
    int col
    int row
    Returns
    Type Description
    RectangleF
    | Edit this page View Source

    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
    | Edit this page View Source

    Scroll(float, float)

    Scrolls the view by a given number of units in graph space. See CellSize to translate this into rows/cols
    Declaration
    public void Scroll(float offsetX, float offsetY)
    Parameters
    Type Name Description
    float offsetX
    float offsetY
    | Edit this page View Source

    SetDriverColorToGraphColor()

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

    Implements

    IDisposable
    ISupportInitializeNotification
    ISupportInitialize
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX