title | page_title | description | tags | position | previous_url | slug |
---|---|---|---|---|---|---|
Getting Started |
.NET MAUI Charts Documentation - Getting Started |
Get started with the Telerik UI for .NET MAUI Chart and add the control to your .NET MAUI project. |
chart, .net maui, ui for .net maui, maui, microsoft, |
2 |
/controls/chart/chart-getting-started |
chart-getting-started |
This guide provides the information you need to start using the Telerik UI for .NET MAUI Chart by adding the control to your project.
At the end, you will achieve the following result.
Before adding the Chart, you need to:
-
[Set up your .NET MAUI application]({%slug maui-getting-started %}#step-1-set-up-your-net-maui-application).
-
[Download Telerik UI for .NET MAUI]({% slug maui-getting-started %}#step-2-download-telerik-ui-for-net-maui).
-
[Install Telerik UI for .NET MAUI]({%slug maui-getting-started %}#step-3-install-telerik-ui-for-net-maui).
**1.**When your .NET MAUI application is set up, you are ready to add a Chart control to your page.
var chart = new RadCartesianChart
{
HorizontalAxis = new CategoricalAxis(),
VerticalAxis = new NumericalAxis(),
BindingContext = new ViewModel()
};
var series = new BarSeries();
series.SetBinding(ChartSeries.ItemsSourceProperty, new Binding("Data"));
series.ValueBinding = new PropertyNameDataPointBinding { PropertyName = "Value" };
series.CategoryBinding = new PropertyNameDataPointBinding { PropertyName = "Category" };
chart.Series.Add(series);
**2.**Add the following namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
using Telerik.Maui.Controls.Compatibility.Chart;
3. Register the Telerik controls through the Telerik.Maui.Controls.Compatibility.UseTelerik
extension method called inside the CreateMauiApp
method of the MauiProgram.cs
file of your project:
using Telerik.Maui.Controls.Compatibility;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseTelerik()
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
return builder.Build();
}
}
1. Now that you have added the control to your project, define the business model:
2. Set the ViewModel:
- .NET MAUI Chart Product Page
- .NET MAUI Chart Forum Page
- Telerik .NET MAUI Blogs
- Telerik .NET MAUI Roadmap
- [Cartesian Charts]({% slug chart-types-cartesian-chart %})
- [Pie Charts]({% slug chart-types-pie-chart %})
- [Chart Series]({% slug chart-series-overview %})
- [Chart Behaviors]({% slug chart-behaviors-selection %})
- [Chart Axes]({% slug axes-categorical-axis %})
- [Chart Legend]({% slug chart-features-legend %})