https://github.com/royben/RealTimeGraphX
High performance real-time graph for WPF & UWP
https://github.com/royben/RealTimeGraphX
Last synced: 2 months ago
JSON representation
High performance real-time graph for WPF & UWP
- Host: GitHub
- URL: https://github.com/royben/RealTimeGraphX
- Owner: royben
- License: mit
- Created: 2019-01-20T10:44:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T18:56:06.000Z (over 2 years ago)
- Last Synced: 2024-10-04T17:09:02.074Z (8 months ago)
- Language: C#
- Size: 444 KB
- Stars: 215
- Watchers: 13
- Forks: 47
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-csharp - RealTimeGraphX - RealTimeGraphX is a data type agnostic, high performance plotting library for WPF, UWP and soon, Xamarin Forms. (Graphics)
- awesome-dotnet-cn - RealTimeGraphX - RealTimeGraphX 是用于WPF、UWP和Xamarin Forms(不久后实现)的与数据类型无关的高性能绘图库。 (图形)
- awsome-dotnet - RealTimeGraphX - RealTimeGraphX is a data type agnostic, high performance plotting library for WPF, UWP and soon, Xamarin Forms. (Graphics)
- awesome-dotnet - RealTimeGraphX - RealTimeGraphX is a data type agnostic, high performance plotting library for WPF, UWP and soon, Xamarin Forms. (Graphics)
README
# RealTimeGraphX
[](https://sirilix.visualstudio.com/RealTimeGraphX/_build/latest?definitionId=5&branchName=master)  [](https://www.nuget.org/packages/RealTimeGraphX/) [](https://www.nuget.org/packages/RealTimeGraphX.WPF/)
RealTimeGraphX is a data type agnostic, high performance plotting library for WPF and UWP.
The library core components are built using .Net Standard which makes it portable to a range of platforms.
Typical use case is, scientific measurements applications which requires real-time display with large data volumes.
RealTimeGraphX has a number of built-in data point types (axis) like Double, Float, Int32 ,TimeSpan and DateTime, but you can easily implement any kind of custom data type by inheriting and implementing the mathematical logic for that type.
### Features:
- **High performance**
- **Thread safe**
- **MVVM support**
- **Any type of data point**
- **Zooming and panning**
The solution contains demo projects for WPF and UWP.
**Single Series**

**Multi Series**

**Gradient Fill**

The follwing diagrams demonstrates the connections between graph components and how they are implemented on each platform.**Model**

The graph controller binds to a renderer and a surface. Data points are pushed to the controller, the controller uses the renderer in orderer to prepare and arrange the points for visual display. Finally, the controller directs the renderer to draw the points on the specific surface.
**WPF Stack Implementation**

Each platform (WPF/UWP etc.) should implement it's own *IGraphDataSeries* and *IGraphSurface*.
Example
##### Model.cs
```csharp
public class ViewModel
{
//Graph controller with timespan as X axis and double as Y.
public WpfGraphController Controller { get; set; }public ViewModel()
{
Controller = new WpfGraphController();
Controller.Renderer = new ScrollingLineRenderer();
Controller.DataSeriesCollection.Add(new WpfGraphDataSeries()
{
Name = "Series Name",
Stroke = Colors.Red,
});//We will attach the surface using WPF binding...
//Controller.Surface = null;
}private void Start()
{
Stopwatch watch = new Stopwatch();
watch.Start();Thread thread = new Thread(() =>
{
while (true)
{
//Get the current elapsed time and mouse position.
var y = System.Windows.Forms.Cursor.Position.Y;
var x = watch.Elapsed;//Push the x,y to the controller.
Controller.PushData(x, y);Thread.Sleep(30);
}
});
thread.Start();
}
}
```##### View.xaml
```xaml
```