|
2 | 2 | <Border xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
4 | 4 | xmlns:chart="clr-namespace:Syncfusion.Maui.Toolkit.Charts;assembly=Syncfusion.Maui.Toolkit" |
5 | | - xmlns:controls="clr-namespace:DeveloperBalance.Pages.Controls" |
| 5 | + xmlns:controls="clr-namespace:DeveloperBalance.Pages.Controls" |
6 | 6 | xmlns:shimmer="clr-namespace:Syncfusion.Maui.Toolkit.Shimmer;assembly=Syncfusion.Maui.Toolkit" |
7 | 7 | xmlns:pageModels="clr-namespace:DeveloperBalance.PageModels" |
8 | 8 | x:Class="DeveloperBalance.Pages.Controls.CategoryChart" |
9 | 9 | HeightRequest="{OnIdiom 300, Phone=200}" |
| 10 | + x:DataType="pageModels:MainPageModel" |
10 | 11 | Style="{StaticResource CardStyle}"> |
11 | 12 | <shimmer:SfShimmer |
12 | 13 | AutomationProperties.IsInAccessibleTree="False" |
13 | 14 | BackgroundColor="Transparent" |
14 | 15 | VerticalOptions="Fill" |
15 | | - IsActive ="{Binding IsBusy}"> |
| 16 | + IsActive="{Binding IsBusy}"> |
16 | 17 | <shimmer:SfShimmer.CustomView> |
17 | 18 | <Grid> |
18 | 19 | <BoxView |
|
22 | 23 | </Grid> |
23 | 24 | </shimmer:SfShimmer.CustomView> |
24 | 25 | <shimmer:SfShimmer.Content> |
25 | | - <chart:SfCircularChart x:Name="Chart" SemanticProperties.Description="Task Categories Chart"> |
26 | | - <chart:DoughnutSeries |
| 26 | + <chart:SfCircularChart x:Name="Chart" |
| 27 | + SemanticProperties.Description="Task Categories Chart"> |
| 28 | + <chart:SfCircularChart.Resources> |
| 29 | + <controls:ChartDataLabelConverter x:Key="ChartDataLabelConverter"/> |
| 30 | + </chart:SfCircularChart.Resources> |
| 31 | + <chart:DoughnutSeries |
27 | 32 | ItemsSource="{Binding TodoCategoryData}" |
28 | 33 | PaletteBrushes="{Binding TodoCategoryColors}" |
29 | 34 | XBindingPath="Title" |
|
32 | 37 | EnableTooltip="False" |
33 | 38 | x:Name="doughnutSeries" |
34 | 39 | Radius="{OnIdiom 0.6, Phone=0.5}" |
35 | | - InnerRadius="0.7" > |
| 40 | + InnerRadius="0.7"> |
36 | 41 | <chart:DoughnutSeries.LabelTemplate> |
37 | | - <DataTemplate > |
38 | | - <HorizontalStackLayout> |
39 | | - <Label Text="{Binding Item.Title}" TextColor="{AppThemeBinding |
| 42 | + <DataTemplate> |
| 43 | + <HorizontalStackLayout x:DataType="chart:ChartDataLabel"> |
| 44 | + <Label Text="{Binding Item, Converter={StaticResource ChartDataLabelConverter}, ConverterParameter='title'}" |
| 45 | + TextColor="{AppThemeBinding |
40 | 46 | Light={StaticResource DarkOnLightBackground}, |
41 | | - Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/> |
42 | | - <Label Text=": " TextColor="{AppThemeBinding |
| 47 | + Dark={StaticResource LightOnDarkBackground}}" |
| 48 | + FontSize="{OnIdiom 18, Phone=14}"/> |
| 49 | + <Label Text=": " |
| 50 | + TextColor="{AppThemeBinding |
43 | 51 | Light={StaticResource DarkOnLightBackground}, |
44 | | - Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/> |
45 | | - <Label Text="{Binding Item.Count}" TextColor="{AppThemeBinding |
| 52 | + Dark={StaticResource LightOnDarkBackground}}" |
| 53 | + FontSize="{OnIdiom 18, Phone=14}"/> |
| 54 | + <Label Text="{Binding Item, Converter={StaticResource ChartDataLabelConverter}, ConverterParameter='count'}" |
| 55 | + TextColor="{AppThemeBinding |
46 | 56 | Light={StaticResource DarkOnLightBackground}, |
47 | | - Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/> |
| 57 | + Dark={StaticResource LightOnDarkBackground}}" |
| 58 | + FontSize="{OnIdiom 18, Phone=14}"/> |
48 | 59 | </HorizontalStackLayout> |
49 | 60 | </DataTemplate> |
50 | 61 | </chart:DoughnutSeries.LabelTemplate> |
51 | 62 |
|
52 | 63 | <chart:DoughnutSeries.DataLabelSettings> |
53 | | - <chart:CircularDataLabelSettings LabelPosition="Outside" SmartLabelAlignment="Shift"> |
| 64 | + <chart:CircularDataLabelSettings LabelPosition="Outside" |
| 65 | + SmartLabelAlignment="Shift"> |
54 | 66 | <chart:CircularDataLabelSettings.ConnectorLineSettings> |
55 | | - <chart:ConnectorLineStyle ConnectorType="Line" StrokeWidth="3" ></chart:ConnectorLineStyle> |
| 67 | + <chart:ConnectorLineStyle ConnectorType="Line" |
| 68 | + StrokeWidth="3"></chart:ConnectorLineStyle> |
56 | 69 | </chart:CircularDataLabelSettings.ConnectorLineSettings> |
57 | 70 | </chart:CircularDataLabelSettings> |
58 | 71 | </chart:DoughnutSeries.DataLabelSettings> |
|
0 commit comments