Table of Contents

Class GraphControl

Namespace
Bonsai.Design.Visualizers
Assembly
Bonsai.Design.Visualizers.dll

Provides a dynamic graph control with a built-in color cycle palette.

public class GraphControl : ZedGraphControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Inheritance
GraphControl
Implements
Inherited Members
ZedGraphControl.SelectModifierKeys
ZedGraphControl.IsScrollY2

Constructors

GraphControl()

Initializes a new instance of the GraphControl class.

public GraphControl()

Properties

AutoScaleAxis

Gets or sets a value indicating whether to recalculate the axis range automatically when redrawing the graph.

public bool AutoScaleAxis { get; set; }

Property Value

bool

MouseDown

Occurs when the mouse pointer is over the control and a mouse button is pressed.

public IObservable<MouseEventArgs> MouseDown { get; }

Property Value

IObservable<MouseEventArgs>

MouseMove

Occurs when the mouse pointer is moved over the control.

public IObservable<MouseEventArgs> MouseMove { get; }

Property Value

IObservable<MouseEventArgs>

MouseUp

Occurs when the mouse pointer is over the control and a mouse button is released.

public IObservable<MouseEventArgs> MouseUp { get; }

Property Value

IObservable<MouseEventArgs>

Methods

GetColor(int)

Returns the color in the color cycle at the specified index.

public static Color GetColor(int colorIndex)

Parameters

colorIndex int

The index of the color to retrieve.

Returns

Color

A Color value representing the color at the specified index of the color cycle.

GetNextColor()

Returns the next color in the color cycle, and increments the color index.

public Color GetNextColor()

Returns

Color

A Color value representing the next color in the color cycle.

GetNormalizedRectangle(RectangleF, Point, Point)

Computes a rectangle defined by the specified points which is also contained inside the pane boundaries.

protected static Rectangle GetNormalizedRectangle(RectangleF bounds, Point p1, Point p2)

Parameters

bounds RectangleF

The bounds of the pane on which to contain the rectangle.

p1 Point

The first point defining the selected rectangle.

p2 Point

The second point defining the selected rectangle.

Returns

Rectangle

A Rectangle which is contained inside the pane boundaries and is defined by the specified points.

OnHandleDestroyed(EventArgs)

Raises the HandleDestroyed event.

protected override void OnHandleDestroyed(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnPaint(PaintEventArgs)

Called by the system to update the control on-screen

protected override void OnPaint(PaintEventArgs e)

Parameters

e PaintEventArgs

A PaintEventArgs object containing the Graphics specifications for this Paint event.

ResetColorCycle()

Resets the color cycle to the first color in the palette.

public void ResetColorCycle()

SetLayout(int, int)

Sets the number of rows and columns in the layout explicitly for graphs with multiple panes.

public void SetLayout(int rows, int columns)

Parameters

rows int

The number of rows in the pane layout.

columns int

The number of columns in the pane layout.

SetLayout(PaneLayout)

Sets the auto layout strategy for graphs with multiple panes.

public void SetLayout(PaneLayout layout)

Parameters

layout PaneLayout

Specifies the auto layout options for graphs with multiple panes.

UpdateRubberBand(Rectangle, Rectangle)

Updates the state of the rubber band selection overlay.

protected void UpdateRubberBand(Rectangle bandRect, Rectangle invalidateRect)

Parameters

bandRect Rectangle

The location and size of the rubber band selection.

invalidateRect Rectangle

The region of the control that should be invalidated following the rubber band update operation. See the Invalidate(Rectangle) method.