ScottPlot.NET
GitHub Repo stars

ScottPlot 5.0 Demo

The ScottPlot 5.0 Demo is a click-to-run application that demonstrates capabilities of ScottPlot. The demo application displays all ScottPlot 5.0 Cookbook recipes and demonstrates advanced user control features which are useful in GUI environments.

Notable Demos

Show Value Under Mouse

The show value under mouse demo uses the control’s MouseMove event to determine the position of the cursor using Plot.GetCoordinates(), determines if a data point is beneath the cursor, and if so places a circular Marker around it. Although this demo showcases data from scatter plots, the concept can be applied to any plot type.

Draggable Axis Lines

The draggable axis line demo shows how to use the user control’s MouseDown, MouseUp, and MouseMove events to check whether a plotted object is beneath the mouse, grab it when clicked, move it when dragged, and drop it. Although this demo only showcases dragging axis lines, this technique can be applied to add interactivity to any plot type.

Draggable Axis Spans

The draggable axis span demo shows how to use the user control’s MouseDown, MouseUp, and MouseMove events to check whether a plotted object is beneath the mouse, grab it when clicked, and move or resize it when dragged. Although this demo only showcases dragging axis spans, this technique can be applied to add interactivity to any plot type.

Draggable Data Points

The draggable points demo shows how to use the user control’s MouseDown, MouseUp, and MouseMove events to check whether a plotted object is beneath the mouse, grab it when clicked, move it when dragged, and drop it.

Selectable Data Points

The select points demo shows how to use the control’s MouseDown, MouseUp, and MouseMove events to track where the mouse was pressed, dragged, and released to determine which data points are within the mouse rectangle. It then places Marker objects over the selected data points. Notice that none of these plot types contain mouse-specific logic, but users can add their own without too much complexity.

Shared Axes

The shared axes demo contains two separate plot controls and uses the Plot.RenderManager.AxisLimitsChanged event to detect when a control is manipulated and updates axis limits of the other control.

Axis Rules

The axis rules demo demonstrates how to add to the list of Plot.Axes.Rules which are applied before rendering each frame. This strategy can be used to set boundaries that limit how far the user can zoom in or out, lock the vertical or horizontal axis, or enforce equal axes scaling such that circles and squares cannot be stretched into rectangles and ellipses.

Custom Context Menu

The custom right-click menu shows how to customize the context menu that appears when users right-click the plot. Developers can call the control’s Menu.Clear() method to remove default menu items then call the control’s Menu.Add() method to add new items which call custom actions when clicked.

Custom Mouse Actions

The custom mouse actions demo shows how to customize which mouse actions perform various operations on the plot. This strategy can be used to enable alternative behaviors such as middle-click-drag panning, right-click autoscaling, and left-click launching a context menu.

Multi-Axis

The multi-axis demo plots data with largely different dimensions on multiple axes with different scales, then demonstrates how to interact with the multi-axis plot.

Plot Streaming Data

The data streamer demo displays live data using a fixed number of data points. The oldest data points are removed as new data points are shifted in. If the ManageAxisLimits property is enabled, the data streamer will automatically adjust the axis limits to keep the incoming data in view. The data streamer plot type has options for switching between a wipe view (like an ECG machine) and a scroll view (where the newest data is always on one side of the plot).

Plot Growing Data

The data logger demo displays live data in a List that grows as new data is added. If the ManageAxisLimits property is enabled, the data logger will automatically adjust the axis limits to keep the incoming data in view. The data logger plot type has options for switching between a full signal view or views that focus on the latest portion of the incoming signal.

Plot Live Financial Data

The Live Finance demo demonstrates how to display price OHLC data in real time, modifying the last bar for live updates and adding new bars as time progresses.

ScottPlot 4.1 Demo

The ScottPlot 4.1 Demo is a click-to-run application designed to make it easy to assess the capabilities of ScottPlot. The demo application displays all ScottPlot 4.1 Cookbook recipes and also demonstrate advanced user control features like mouse tracking, live data, and linked plots.