Table of Contents

Class GraphView

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

View for rendering graphs (bar, scatter, etc...).

public class GraphView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IDesignable
Inheritance
GraphView
Implements
Inherited Members

Constructors

GraphView()

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

Properties

Annotations

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

AxisX

Horizontal axis.

AxisY

Vertical axis.

CellSize

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

GraphColor

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

MarginBottom

Amount of space to leave on bottom of the graph. Graph content (Series) will not be rendered in margins but axis labels may be. Use Padding to add a margin outside of the GraphView.

MarginLeft

Amount of space to leave on left of the graph. Graph content (Series) will not be rendered in margins but axis labels may be. Use Padding to add a margin outside of the GraphView.

ScrollOffset

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

Series

Collection of data series that are rendered in the graph.

Methods

DrawLine(Point, Point, Rune)

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

GraphSpaceToScreen(PointF)

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

OnDrawingContent()

Called when the View's content is to be drawn. The default implementation does nothing.

PageDown()

Scrolls the graph down 1 page.

PageUp()

Scrolls the graph up 1 page.

Reset()

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

ScreenToGraphSpace(Rectangle)

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

ScreenToGraphSpace(int, int)

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

Scroll(float, float)

Scrolls the view by a given number of units in graph space. See CellSize to translate this into rows/cols.

SetDriverColorToGraphColor()

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