Skip to content

Commit 5cd959d

Browse files
Merge pull request #4 from SyncfusionExamples/WPF-61990-Update-readme
WPF-61990 Update readme
2 parents 8c3bdc7 + e9a825a commit 5cd959d

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# How to bind the Xamarin.Forms pie chart tooltip to Others category values
1+
# How to bind the Xamarin.Forms pie chart tooltip to "Others" category values (SfChart)?
22

3-
We always like to group smaller pie chart values into the category "Others" to increase chart readability. But we also think about ways to show those grouped values in UI.
3+
We always like to group smaller pie chart values into the category "Others" to increase chart readability. But we also think about ways to show those grouped values in UI.
44

5-
In this article, we will discuss in detail “How to show grouped values of Xamarin.Forms Pie Chart using tooltip?” By the following ways, we can display the average of clustered values, either can display individual value present in it.
5+
In this example illustrates how to show grouped values of [Xamarin.Forms Pie Chart](https://www.syncfusion.com/xamarin-ui-controls/xamarin-charts/chart-types) using tooltip by these following ways, you can display the average of clustered values, either can display the individual value present in it.
66

77
## How to show sum of values that grouped at Xamarin Pie Chart
88

9-
The example of the code below shows “How to calculate and display the average of grouped value using tooltip template?”
10-
9+
The below code example shows how to calculate and display the average of grouped value using the tooltip template.
1110

1211
### Step 1: Declaration IValueConverter to calculate average values.
13-
1412
```
1513
public class ChartAvgValueConverter : IValueConverter
1614
{
@@ -46,7 +44,6 @@ public class ChartAvgValueConverter : IValueConverter
4644
```
4745

4846
### Step 2: DataTemplate declarations.
49-
5047
```
5148
<ContentView.Resources>
5249
<local:ChartAvgValueConverter x:Key="sumOfValuesConverter"/>
@@ -60,9 +57,8 @@ public class ChartAvgValueConverter : IValueConverter
6057
```
6158

6259
### Step 3: DataTemplate defined in the Series Tooltip Template.
63-
64-
```
65-
<chart:SfChart BackgroundColor="Transparent">
60+
```
61+
<chart:SfChart BackgroundColor="Transparent">
6662
. . .
6763
<chart:SfChart.Series>
6864
<chart:PieSeries
@@ -83,12 +79,13 @@ public class ChartAvgValueConverter : IValueConverter
8379
</chart:SfChart>
8480
```
8581

82+
![Tooltip template to show average of grouped values](https://user-images.githubusercontent.com/53489303/200767677-31beb677-b8f8-4367-ace3-9c55756d033d.png)
83+
8684
## How to bind the Xamarin.Forms Pie Chart grouped data collection to the Tooltip
8785

88-
The example of the code below shows “How to display the values which present inside the group ‘Others’?”
86+
The below code example shows how to display the values, which present inside the group ‘Others’.
8987

90-
Step 1: Declaration IValueConverter to generate BindableLayout ItemsSource
91-
88+
### Step 1: Declaration IValueConverter to generate BindableLayout ItemsSource
9289
```
9390
public class ChartValueConverter : IValueConverter
9491
{
@@ -115,8 +112,7 @@ public class ChartValueConverter : IValueConverter
115112
}
116113
```
117114

118-
Step 2: DataTemplate declarations with any of the BindableLayout.
119-
115+
### Step 2: DataTemplate declarations with any of the BindableLayout.
120116
```
121117
<ContentView.Resources>
122118
<local:ChartValueConverter x:Key="itemsSourceConverter"/>
@@ -135,8 +131,7 @@ Step 2: DataTemplate declarations with any of the BindableLayout.
135131
</ContentView.Resources>
136132
```
137133

138-
Step 3: DataTemplate defined in the Series Tooltip Template.
139-
134+
### Step 3: DataTemplate defined in the Series Tooltip Template.
140135
```
141136
<chart:SfChart BackgroundColor="Transparent">
142137
. . .
@@ -154,4 +149,20 @@ Step 3: DataTemplate defined in the Series Tooltip Template.
154149
<chart:ChartTooltipBehavior BackgroundColor="LightBlue
155150
</chart:SfChart.ChartBehaviors>
156151
</chart:SfChart>
157-
```
152+
```
153+
154+
![Tooltip template shows individual value present in the others category](https://user-images.githubusercontent.com/53489303/200767964-25b1ed57-fb93-4f40-97d8-03fbed7c7ef5.png)
155+
156+
KB article - [How to bind the Xamarin.Forms pie chart tooltip to “Others” category values](https://www.syncfusion.com/kb/11861/how-to-bind-the-xamarin-forms-pie-chart-tooltip-to-others-category-values)
157+
158+
### Related links
159+
160+
[Group small data points into “others”](https://help.syncfusion.com/xamarin/charts/charttypes#group-small-data-points-into-others)
161+
162+
[Bindable Layouts in Xamarin.Forms](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/bindable-layouts)
163+
164+
### See also
165+
166+
[How to set size of pie/doughnut?](https://www.syncfusion.com/kb/5525/how-to-set-size-of-pie-doughnut)
167+
168+
[How to explode the pie series slice on touch?](https://www.syncfusion.com/kb/5923/how-to-explode-the-pie-series-slice-on-touch)

0 commit comments

Comments
 (0)