1. Select File -> New -> Solution in the Xamarin Studio menu. Then select Multiplatform App -> Xamarin.Forms (Forms App). Click 'Next'. Type in the name of your application, say, MyChartApp, select the target platforms - Android, iOS and/or UWP - and click 'Next'. Choose the location of your solution and click 'Create'.
2. Expand the shared project MyChartApp and add references to the MindFusion.Common.dll, MindFusion.Charting.dll and MindFusion.Licensing.dll assemblies. Open the MyChartAppPage.xaml file located in the same project. In the root ContentPage tag declare a new XML namespace to MindFusion.Charting, as follows:
XAML
![]() |
---|
xmlns:calendar="clr-namespace:MindFusion.Charting.Controls;assembly=MindFusion.Charting;" |
3. Now you can add dashboards or charts to the page. Dashboard lets you display multiple plots and axes in dynamic layout. Chart controls display a single plot and type of graphics by default, but new ones can be added to them as well. For example, create a bar chart:
XAML
![]() |
---|
<calendar:BarChart x:Name="myChart" /> |
4. You can now add data to the chart's Series collection. Open the code behind file – MyChartAppPage.xaml.cs – and add data series using either ones of the pre-defined series classes (such as SimpleSeries, Series2D, XmlSeries, DataBoundSeries) or by implementing the Series interface in your own model class. For example:
C#
![]() |
---|
myChart.Series = new ObservableCollection<Series> |
Don't forget to add the necessary namespace at the top of the file:
C#
![]() |
---|
using System.Collections.Generic; |
5. Now, add references to the core assemblies MindFusion.Common.dll and MindFusion.Charting.dll followed by the respective platform assemblies to the individual platform projects. More specifically, add MindFusion.Common.Android.dll and MindFusion.Charting.Android.dll to MyChartApp.Droid and MindFusion.Common.iOS.dll and MindFusion.Charting.iOS.dll to MyChartApp.iOS, and MindFusion.Common.Universal.dll and MindFusion.Charting.Universal.dll to MyChartApp.Universal.
If targeting Android:
C#
![]() |
---|
protected override void OnCreate(Bundle savedInstanceState) |
If targeting iOS:
C#
![]() |
---|
public override bool FinishedLaunching(UIApplication app, NSDictionary options) |
If targeting UWP:
C#
![]() |
---|
Frame rootFrame = Window.Current.Content as Frame; |
6. Build and run the solution to see the result.
7. If you need to build a more complex dashboard, follow Tutorial 1.