Skip to content

Commit

Permalink
Updated the model and view model
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Oct 23, 2024
1 parent c638187 commit 427b785
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion CartesianChart/GettingStarted/GettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
x:Class="GettingStarted.MainPage">

<ContentPage.BindingContext>
<model:ViewModel/>
<model:PersonViewModel />
</ContentPage.BindingContext>

<chart:SfCartesianChart>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GettingStarted
{
public class Person
public class PersonModel
{
public string? Name { get; set; }
public double Height { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace GettingStarted
{
public class PersonViewModel
{
public List<PersonModel> Data { get; set; }
public PersonViewModel()
{
Data = new List<PersonModel>()
{
new PersonModel { Name = "David", Height = 170 },
new PersonModel { Name = "Michael", Height = 96 },
new PersonModel { Name = "Steve", Height = 65 },
new PersonModel { Name = "Joel", Height = 182 },
new PersonModel { Name = "Bob", Height = 134 }
};
}
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion CircularChart/GettingStarted/GettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</chart:SfCircularChart.Title>

<chart:SfCircularChart.BindingContext>
<model:ViewModel/>
<model:SalesViewModel/>
</chart:SfCircularChart.BindingContext>

<chart:SfCircularChart.Legend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GettingStarted
{
public class Sales
public class SalesModel
{
public string? Product { get; set; }
public double SalesRate { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace GettingStarted
{
public class SalesViewModel
{
public List<SalesModel> Data { get; set; }

public SalesViewModel()
{
Data = new List<SalesModel>()
{
new SalesModel(){Product = "iPad", SalesRate = 70},
new SalesModel(){Product = "iPhone", SalesRate = 65},
new SalesModel(){Product = "MacBook", SalesRate = 60},
new SalesModel(){Product = "Mac", SalesRate = 55},
new SalesModel(){Product = "Others", SalesRate = 50},
};
}
}
}
19 changes: 0 additions & 19 deletions CircularChart/GettingStarted/GettingStarted/ViewModel/ViewModel.cs

This file was deleted.

2 changes: 1 addition & 1 deletion FunnelChart/GettingStarted/GettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</chart:SfFunnelChart.Title>

<chart:SfFunnelChart.BindingContext>
<model:ChartViewModel/>
<model:AdmissionViewModel/>
</chart:SfFunnelChart.BindingContext>

<chart:SfFunnelChart.Legend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GettingStarted
{
public class Admission
public class AdmissionModel
{
public string? XValue { get; set; }
public double YValue { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace GettingStarted
{
public class AdmissionViewModel
{
public List<AdmissionModel> Data { get; set; }

public AdmissionViewModel()
{
Data = new List<AdmissionModel>()
{
new AdmissionModel() {XValue = "Enrolled", YValue=175},
new AdmissionModel() {XValue = "Admits", YValue=190},
new AdmissionModel() {XValue = "Applicants", YValue=245},
new AdmissionModel() {XValue = "Inquiries ", YValue=290},
new AdmissionModel() {XValue = "Prospects ", YValue=320},
};
}
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion PolarChart/GettingStarted/GettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
x:Class="GettingStarted.MainPage">

<ContentPage.BindingContext>
<model:ViewModel/>
<model:PlantViewModel/>
</ContentPage.BindingContext>

<chart:SfPolarChart>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GettingStarted
{
public class Model
public class PlantModel
{
public string? Direction { get; set; }
public double Tree { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.ObjectModel;

namespace GettingStarted
{
public class PlantViewModel
{
public ObservableCollection<PlantModel> PlantDetails { get; set; }
public PlantViewModel()
{
PlantDetails = new ObservableCollection<PlantModel>()
{
new PlantModel(){ Direction = "North", Tree = 80, Flower = 42, Weed = 63},
new PlantModel(){ Direction = "NorthEast", Tree = 85, Flower = 40, Weed = 70},
new PlantModel(){ Direction = "East", Tree = 78 , Flower = 47, Weed = 65},
new PlantModel(){ Direction = "SouthEast", Tree = 90 , Flower = 40, Weed = 70},
new PlantModel(){ Direction = "South", Tree = 78 , Flower = 27, Weed = 47},
new PlantModel(){ Direction = "SouthWest", Tree = 83 , Flower = 45, Weed = 65},
new PlantModel(){ Direction = "West", Tree = 79 , Flower = 40, Weed = 58},
new PlantModel(){ Direction = "NorthWest", Tree = 88 , Flower = 38, Weed = 73}
};
}
}
}
23 changes: 0 additions & 23 deletions PolarChart/GettingStarted/GettingStarted/ViewModel/ViewModel.cs

This file was deleted.

2 changes: 1 addition & 1 deletion PyramidChart/GettingStarted/GettingStarted/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</chart:SfPyramidChart.Title>

<chart:SfPyramidChart.BindingContext>
<model:ChartViewModel/>
<model:StageViewModel/>
</chart:SfPyramidChart.BindingContext>

<chart:SfPyramidChart.Legend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GettingStarted
{
public class Stage
public class StageModel
{
public string? Name { get; set; }
public double Value { get; set; }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace GettingStarted
{
public class StageViewModel
{
public List<StageModel> Data { get; set; }

public StageViewModel()
{
Data = new List<StageModel>()
{
new StageModel(){Name = "Stage A", Value=12},
new StageModel(){Name = "Stage B", Value=21},
new StageModel(){Name = "Stage C", Value=29},
new StageModel(){Name = "Stage D", Value=37},
};
}
}
}

0 comments on commit 427b785

Please sign in to comment.