Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxim-saplin/TimeSeries-Xamarin
ASCII time series chart for Xamarin.Forms
https://github.com/maxim-saplin/TimeSeries-Xamarin
Last synced: 29 days ago
JSON representation
ASCII time series chart for Xamarin.Forms
- Host: GitHub
- URL: https://github.com/maxim-saplin/TimeSeries-Xamarin
- Owner: maxim-saplin
- License: mit
- Created: 2020-05-02T19:52:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-02T15:04:46.000Z (over 4 years ago)
- Last Synced: 2024-11-07T09:53:43.369Z (about 1 month ago)
- Language: C#
- Size: 2.13 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - TimeSeries-Xamarin ★3
README
21KB .NET Standard library (compared to at least 8MB for any SkiaSharp based chart control).
A visual element built purely on top of Xamarin.Forms controls (no platform renderers or platform-specific code) that displays ASCII time series chart via multi-line monospaced Label wrapped in a Grid. The control can resize to adapt to it's container. It was tested on Android, iOS, macOS and WPF though should work fine across Xamarin.Froms supported platforms.
Based on this [repo](https://github.com/maxim-saplin/AsciiTimeSeries) and used in this [app](https://play.google.com/store/apps/details?id=xcom.saplin.xOPS).
# Usage
1. Add [Nuget](https://www.nuget.org/packages/Saplin.TimeSeries.Xamarin/) package or reference to `Saplin.TimeSeries.Xamarin.dll` library (check [Releases](https://github.com/maxim-saplin/TimeSeries-Xamarin/releases)) to your Xamarin.Forms UI project2. Add XAML reference to control's namespace in a view file:
``````
- in this case `HeightLines` is set to `0` so that the chart could grow vertically together with it's container.4. Set `Series` property in code behind (or via Binding).
```
timeSeries.Series = GenerateRandom(counter);
```Check the demo project in this repo.
# Monospaced Font
It is important to use a monospaced font (set via `FontFamily` property) that has all the ASCII box chars (`╭│╯─┤ `) and misc chars (e.g. `·` set in `AbovePointChar` property) to have the control properly displayed. Default font family works fine on iOS, macOS and WPF. Default Android's `monospace` font is NOT OK. You can use [Source Code Pro](https://github.com/maxim-saplin/TimeSeries-Xamarin/blob/master/Saplin.TimeSeries.XamarinDemo/SourceCodePro-Regular.ttf) font and import it like [that](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/fonts#use-a-custom-font) (iOS, Android) or [that](http://saplin.blogspot.com/2018/12/xamarinforms-custom-fonts-with-android.html) (macOS, WPF).![UI](https://github.com/maxim-saplin/TimeSeries-Xamarin/blob/master/TimeSeries-Xamarin.gif?raw=true)