1515
1616 <chart:SfFunnelChart/>
1717</ContentPage>
18-
1918```
2019
2120** [ C#] **
2221```
23-
2422using Syncfusion.Maui.Charts;
2523. . .
2624
@@ -40,7 +38,6 @@ Syncfusion.Maui.Core Nuget is a dependent package for all Syncfusion controls of
4038
4139** [ C#] **
4240```
43-
4441using Microsoft.Maui;
4542using Microsoft.Maui.Hosting;
4643using Microsoft.Maui.Controls.Compatibility;
@@ -67,7 +64,6 @@ namespace ChartGettingStarted
6764 }
6865 }
6966}
70-
7167```
7268
7369## Initialize view model
@@ -76,20 +72,17 @@ Now, let us define a simple data model that represents a data point in the chart
7672
7773** [ C#] **
7874```
79-
8075 public class Admission
8176{
8277 public string XValue { get; set; }
8378 public double YValue { get; set; }
8479}
85-
8680```
8781
8882Next, create a view model class and initialize a list of ` Model ` objects as follows.
8983
9084** [ C#] **
9185```
92-
9386public class ChartViewModel
9487{
9588 public List<Admission> Data { get; set; }
@@ -106,7 +99,6 @@ public class ChartViewModel
10699 };
107100 }
108101}
109-
110102```
111103
112104Create a ` ViewModel ` instance and set it as the chart's ` BindingContext ` . This enables property binding from ` ViewModel ` class.
@@ -116,7 +108,6 @@ Add the namespace of `ViewModel` class to your XAML Page, if you prefer to set `
116108
117109** [ XAML] **
118110```
119-
120111<ContentPage
121112 . . .
122113 xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
@@ -128,15 +119,12 @@ Add the namespace of `ViewModel` class to your XAML Page, if you prefer to set `
128119 </chart:SfFunnelChart.BindingContext>
129120 </chart:SfFunnelChart>
130121</ContentPage>
131-
132122```
133123
134124** [ C#] **
135125```
136-
137126ChartViewModel viewModel = new ChartViewModel();
138127chart.BindingContext = viewModel;
139-
140128```
141129
142130## Populate chart with data
@@ -145,26 +133,22 @@ chart.BindingContext = viewModel;
145133
146134** [ XAML] **
147135```
148-
149136<chart:SfFunnelChart ItemsSource="{Binding Data}"
150137 XBindingPath="XValue"
151138 YBindingPath="YValue"/>
152139. . .
153140</chart:SfFunnelChart>
154-
155141```
156142
157143** [ C#] **
158144```
159-
160145SfFunnelChart chart = new SfFunnelChart();
161146ChartViewModel viewModel = new ChartViewModel();
162147chart.BindingContext = viewModel;
163148chart.ItemsSource = viewModel.Data;
164149chart.XBindingPath = "XValue";
165150chart.YBindingPath = "YValue";
166151this.Content = chart;
167-
168152```
169153
170154## Add a title
@@ -173,25 +157,21 @@ The title of the chart acts as the title to provide quick information to the use
173157
174158** [ XAML] **
175159```
176-
177160<chart:SfFunnelChart>
178161 <chart:SfFunnelChart.Title>
179162 <Label Text="School Admission"/>
180163 </chart:SfFunnelChart.Title>
181164 . . .
182165</chart:SfFunnelChart>
183-
184166```
185167
186168** [ C#] **
187169```
188-
189170SfFunnelChart chart = new SfFunnelChart();
190171chart.Title = new Label
191172{
192173 Text = "School Admission"
193174};
194-
195175```
196176
197177## Enable the data labels
@@ -200,20 +180,16 @@ The [ShowDataLabels]() property of the chart can be used to enable data labels t
200180
201181** [ XAML] **
202182```
203-
204183<chart:SfFunnelChart ShowDataLabels="True">
205184 . . .
206185</chart:SfFunnelChart>
207-
208186```
209187
210188** [ C#] **
211189```
212-
213190SfFunnelChart chart = new SfFunnelChart();
214191. . .
215192chart.ShowDataLabels = true;
216-
217193```
218194
219195## Enable a legend
@@ -222,23 +198,19 @@ The legend provides information about the data point displayed in the funnel cha
222198
223199** [ XAML] **
224200```
225-
226201<chart:SfFunnelChart>
227202 . . .
228203 <chart:SfFunnelChart.Legend>
229204 <chart:ChartLegend/>
230205 </chart:SfFunnelChart.Legend>
231206</chart:SfFunnelChart>
232-
233207```
234208
235209** [ C#] **
236210```
237-
238211SfFunnelChart chart = new SfFunnelChart();
239212. . .
240213chart.Legend = new ChartLegend();
241-
242214```
243215
244216## Enable Tooltip
@@ -247,27 +219,22 @@ Tooltips are used to show information about the segment, when mouse over on it.
247219
248220** [ XAML] **
249221```
250-
251222<chart:SfFunnelChart EnableTooltip="True">
252223 . . .
253224</chart:SfFunnelChart>
254-
255225```
256226
257227** [ C#] **
258228```
259-
260229SfFunnelChart chart = new SfFunnelChart();
261230. . .
262231chart.EnableTooltip = true;
263-
264232```
265233
266234The following code example gives you the complete code of above configurations.
267235
268236** [ XAML] **
269237```
270-
271238<chart:SfFunnelChart ItemsSource="{Binding Data}"
272239 ShowDataLabels="True"
273240 XBindingPath="XValue"
@@ -283,12 +250,10 @@ The following code example gives you the complete code of above configurations.
283250 <chart:ChartLegend/>
284251 </chart:SfFunnelChart.Legend>
285252</chart:SfFunnelChart>
286-
287253```
288254
289255** [ C#] **
290256```
291-
292257using Syncfusion.Maui.Charts;
293258. . .
294259public partial class MainPage : ContentPage
@@ -312,7 +277,6 @@ public partial class MainPage : ContentPage
312277 this.Content = chart;
313278 }
314279}
315-
316280```
317281
318282![ Funnel chart in .NET MAUI Chart] ( MAUI_funnel_chart.png )
0 commit comments