WPF Chart - Examples
SciChart WPF ships with hundreds of WPF Chart Examples which you can browse, play with, view the source-code and even export each WPF Chart Example to a stand-alone Visual Studio solution. All of this is possible with the new and improved SciChart WPF Examples Suite, which ships as part of the SciChart WPF SDK.
The Trade Markers demo uses the Annotations API to place CustomAnnotations rendering buy and sell or news bullet markers over a simulated price chart.
The CustomAnnotations are created in a ViewModel and contain data-bound to a Trade object, containing Buy, Sell, Quantity and Deal-price information. The SciChartSurface data-binds to the resulting AnnotationCollection and renders the annotations on the chart.
News/Event bullet annotations use AnnotationBase.CoordinateMode = CoordinateMode.RelativeY to always place the event bullet at the bottom of the chart.
Example Usage
Hover over a CustomAnnotation to see a Tooltip showing the details for each trade.
Zoom by dragging, or double-click to reset zoom, to see how annotations automatically update as the chart viewport changes.
Documentation Links
– Annotations API Documentation
– Databinding Annotations with MVVM
– AnnotationBase.CoordinateMode Property
– AnnotationCoordinateMode Enum
The C#/WPF source code for the WPF Chart Trading Buy Sell Markers example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
- Clone the SciChart.WPF.Examples from Github.
- Or, view source in the SciChart WPF Examples suite.
- Also the SciChart WPF Trial contains the full source for the examples (link below).