You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-18Lines changed: 29 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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)?
2
2
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.
4
4
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.
6
6
7
7
## How to show sum of values that grouped at Xamarin Pie Chart
8
8
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.
11
10
12
11
### Step 1: Declaration IValueConverter to calculate average values.
13
-
14
12
```
15
13
public class ChartAvgValueConverter : IValueConverter
16
14
{
@@ -46,7 +44,6 @@ public class ChartAvgValueConverter : IValueConverter
@@ -60,9 +57,8 @@ public class ChartAvgValueConverter : IValueConverter
60
57
```
61
58
62
59
### Step 3: DataTemplate defined in the Series Tooltip Template.
63
-
64
-
```
65
-
<chart:SfChart BackgroundColor="Transparent">
60
+
```
61
+
<chart:SfChart BackgroundColor="Transparent">
66
62
. . .
67
63
<chart:SfChart.Series>
68
64
<chart:PieSeries
@@ -83,12 +79,13 @@ public class ChartAvgValueConverter : IValueConverter
83
79
</chart:SfChart>
84
80
```
85
81
82
+

83
+
86
84
## How to bind the Xamarin.Forms Pie Chart grouped data collection to the Tooltip
87
85
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’.
89
87
90
-
Step 1: Declaration IValueConverter to generate BindableLayout ItemsSource
91
-
88
+
### Step 1: Declaration IValueConverter to generate BindableLayout ItemsSource
92
89
```
93
90
public class ChartValueConverter : IValueConverter
94
91
{
@@ -115,8 +112,7 @@ public class ChartValueConverter : IValueConverter
115
112
}
116
113
```
117
114
118
-
Step 2: DataTemplate declarations with any of the BindableLayout.
119
-
115
+
### Step 2: DataTemplate declarations with any of the BindableLayout.

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