🕓 7 MIN As 2024 wraps up, …
Imagine combining LiveCharts2 (v2), the evolution of LiveCharts (v0), with the power of Uno Platform.  The ability to integrate beautiful, animated, automatically updated, cross-platform, object-oriented and easy-to-use charts opens many possibilities for data visualization-driven applications!
The LiveCharts team has been working hard at expanding support for Uno Platform, and you can now integrate charts, maps, and gauges everywhere Uno Platform runs. LiveCharts2 for Uno Platform contains the following controls:
Cartesian Chart Control
Pie Chart Control
Polar Chart Control
Geo Map Control
Today, LiveCharts2 for Uno Platform is in a preview and is available to everyone via the NuGet package for Uno. You can also visit the new website, which houses the library, and docs, which are fully integrated with Uno Platform and the API explorer. So take it for a spin and see how easy it is to get started using this brand-new suite of controls in your Uno Platform Applications.
Open visual studio 2022, select “Create a new project” then select the Uno Platform App
 template.
Select your target platforms:
Name the project and the solution UnoApp
.
You can install LiveChart from NuGet in the Solution Explorer
, right click on your solution, then Manage NuGet Packages for Solution
, ensure the package source is nuget.org
then in the browser tab, search for LiveChartsCore.SkiaSharpView.Uno.WinUI
(check the include prerelease checkbox), and finally, check all the projects to install LiveCharts on all the platforms in our project.
Let’s start by defining a view model for your chart, in the Solution Explorer
 go to the Shared
 project and then open the MainPage.xaml.cs
 file, and add the next view model class:
using Windows.UI.Xaml.Controls;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace UnoApp;
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
public class ViewModel
{
public ISeries[] Series { get; set; }
= new ISeries[]
{
new LineSeries
{
Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
Fill = null
}
};
}
Now let’s add the control to the UI, in the Shared
 project go to MainPage.xaml
file, and add the namespace for LiveCharts (lvc) and for the view model we just created (local).
Set the Page.DataSource
 to our view model, and finally add the chart and bind the Series
 property to our view model.
Now run the application, and ensure the startup project is UnoApp.Mobile
and browse for an Android emulator.
Now try running the UWP, WPF or GTK projects, the chart is ready to run everywhere! (we keep working on MacOS and iOS).
As you can see, getting started with the suite of controls in LiveCharts2 is easy. Â Now you can start adding charts, maps and gauges to your UI using the LiveCharts2 cross-platform library.Â
There are a lot of samples already built for Uno Platform, every card there opens an example that is ready to run in Uno Platform. The team is continuously improving the library since it is currently still in a beta phase, and continues to improve its looks, performance, and features as we progress to the final release.
If you are new to Uno Platform, follow our official getting started guide. (5 min to complete) This is part 1 of 2 Getting Started tutorials. You can find the second tutorial here.
Tags:
🕓 2 MIN Need a last-minute holiday …
Uno Platform
360 rue Saint-Jacques, suite G101,
Montréal, Québec, Canada
H2Y 1P5
USA/CANADA toll free: +1-877-237-0471
International: +1-514-312-6958
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Uno Platform 5.2 LIVE Webinar – Today at 3 PM EST – Watch