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.SelectModifierKeysZedGraphControl.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
MouseDown
Occurs when the mouse pointer is over the control and a mouse button is pressed.
public IObservable<MouseEventArgs> MouseDown { get; }
Property Value
MouseMove
Occurs when the mouse pointer is moved over the control.
public IObservable<MouseEventArgs> MouseMove { get; }
Property Value
MouseUp
Occurs when the mouse pointer is over the control and a mouse button is released.
public IObservable<MouseEventArgs> MouseUp { get; }
Property Value
Methods
GetColor(int)
Returns the color in the color cycle at the specified index.
public static Color GetColor(int colorIndex)
Parameters
colorIndex
intThe index of the color to retrieve.
Returns
GetNextColor()
Returns the next color in the color cycle, and increments the color index.
public Color GetNextColor()
Returns
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
RectangleFThe bounds of the pane on which to contain the rectangle.
p1
PointThe first point defining the selected rectangle.
p2
PointThe 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
OnPaint(PaintEventArgs)
Called by the system to update the control on-screen
protected override void OnPaint(PaintEventArgs e)
Parameters
e
PaintEventArgsA 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
intThe number of rows in the pane layout.
columns
intThe 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
PaneLayoutSpecifies 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
RectangleThe location and size of the rubber band selection.
invalidateRect
RectangleThe region of the control that should be invalidated following the rubber band update operation. See the Invalidate(Rectangle) method.