Xamarin Chart - Examples
Please note! These examples are new to SciChart Mobile v3 release! SciChart iOS & Android ship with Xamarin.iOS and Xamarin.Android bindings around our native iOS & Android Chart controls, allowing you to create fast & feature rich charts to your Xamarin applications. We include ~90 native iOS examples and 90 Android examples, but now also ~60 Xamarin Chart Examples to help you get started with SciChart. You can download the source for our Xamarin Chart Examples from Github, or browse the source code below.
The Xamarin Realtime Ticking Stock Charts example demonstrates how SciChart library is suitable for real-time trading and stock chart apps even in demanding, live markets.
In this example you may see Ohlc or CandleStick charts updating in real-time. There are also two lines showing two moving averages. You may also see annotations used to show the latest prices on the YAxis.
The data updates in real time. In Android native we call OhlcDataSeries.append() and OhlcDataSeries.update() methods, to add new data to the chart when a timer ticks. Scrolling to the latest bar is handled in code by manipulating the XAxis.VisibleRange property.
In iOS native price data is updated in a SCIOhlcDataSeries in a timer callback. When the data updates, SciChart automatically redraws.
See tutorials on how to add realtime updates in Xamarin here:
- Press the START button to start the real-time update or the PAUSE button to stop it.
- You can freely Pan the chart in horizontal direction even when it’s being updated.
- The X Axis can be dragged to scale the chart in horizontal direction.
- Double-tapping restores zoom level to the extents of the data.
- The Legend can be used to hide or show chart series.
The C#/Xamarin.iOS/Xamarin.Android source code for the Xamarin Realtime Ticking Stock Charts 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.Xamarin.Examples from Github.
- Also, the SciChart for Xamarin Trial contains the full source code for the Xamarin chart examples (link below).