|
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:MauiApp._1.Pages.Controls" |
| 5 | + xmlns:controls="clr-namespace:MauiApp._1.Pages.Controls" |
6 | 6 | xmlns:shimmer="clr-namespace:Syncfusion.Maui.Toolkit.Shimmer;assembly=Syncfusion.Maui.Toolkit" |
7 | 7 | xmlns:pageModels="clr-namespace:MauiApp._1.PageModels" |
8 | 8 | x:Class="MauiApp._1.Pages.Controls.CategoryChart" |
9 | 9 | HeightRequest="{OnIdiom 300, Phone=200}" |
10 | 10 | Margin="0, 12" |
11 | | - Style="{StaticResource CardStyle}" |
12 | | - x:DataType="pageModels:MainPageModel"> |
| 11 | + x:DataType="pageModels:MainPageModel" |
| 12 | + Style="{StaticResource CardStyle}"> |
13 | 13 | <shimmer:SfShimmer |
| 14 | + AutomationProperties.IsInAccessibleTree="False" |
14 | 15 | BackgroundColor="Transparent" |
15 | | - VerticalOptions="FillAndExpand" |
16 | | - IsActive ="{Binding IsBusy}"> |
| 16 | + VerticalOptions="Fill" |
| 17 | + IsActive="{Binding IsBusy}"> |
17 | 18 | <shimmer:SfShimmer.CustomView> |
18 | 19 | <Grid> |
19 | | - <BoxView |
| 20 | + <BoxView |
20 | 21 | CornerRadius="12" |
21 | | - VerticalOptions="FillAndExpand" |
| 22 | + VerticalOptions="Fill" |
22 | 23 | Style="{StaticResource ShimmerCustomViewStyle}"/> |
23 | 24 | </Grid> |
24 | 25 | </shimmer:SfShimmer.CustomView> |
25 | 26 | <shimmer:SfShimmer.Content> |
26 | | - <chart:SfCircularChart x:Name="Chart"> |
27 | | - <chart:SfCircularChart.Legend> |
28 | | - <controls:LegendExt Placement="Right"> |
29 | | - <chart:ChartLegend.LabelStyle> |
30 | | - <chart:ChartLegendLabelStyle |
31 | | - TextColor="{AppThemeBinding |
32 | | - Light={StaticResource DarkOnLightBackground}, |
33 | | - Dark={StaticResource LightOnDarkBackground}}" |
34 | | - Margin="5" |
35 | | - FontSize="18" /> |
36 | | - </chart:ChartLegend.LabelStyle> |
37 | | - </controls:LegendExt> |
38 | | - </chart:SfCircularChart.Legend> |
39 | | - <chart:RadialBarSeries |
| 27 | + <chart:SfCircularChart x:Name="Chart" |
| 28 | + SemanticProperties.Description="Task Categories Chart"> |
| 29 | + <chart:SfCircularChart.Resources> |
| 30 | + <controls:ChartDataLabelConverter x:Key="ChartDataLabelConverter"/> |
| 31 | + </chart:SfCircularChart.Resources> |
| 32 | + <chart:DoughnutSeries |
40 | 33 | ItemsSource="{Binding TodoCategoryData}" |
41 | 34 | PaletteBrushes="{Binding TodoCategoryColors}" |
42 | 35 | XBindingPath="Title" |
43 | | - YBindingPath="Count" |
| 36 | + YBindingPath="Count" |
44 | 37 | ShowDataLabels="True" |
45 | | - EnableTooltip="True" |
46 | | - TrackFill="{AppThemeBinding Light={StaticResource LightBackground}, Dark={StaticResource DarkBackground}}" |
47 | | - CapStyle = "BothCurve"/> |
| 38 | + EnableTooltip="False" |
| 39 | + x:Name="doughnutSeries" |
| 40 | + Radius="{OnIdiom 0.6, Phone=0.5}" |
| 41 | + InnerRadius="0.7"> |
| 42 | + <chart:DoughnutSeries.LabelTemplate> |
| 43 | + <DataTemplate> |
| 44 | + <HorizontalStackLayout x:DataType="chart:ChartDataLabel"> |
| 45 | + <Label Text="{Binding Item, Converter={StaticResource ChartDataLabelConverter}, ConverterParameter='title'}" |
| 46 | + TextColor="{AppThemeBinding |
| 47 | + Light={StaticResource DarkOnLightBackground}, |
| 48 | + Dark={StaticResource LightOnDarkBackground}}" |
| 49 | + FontSize="{OnIdiom 18, Phone=14}"/> |
| 50 | + <Label Text=": " |
| 51 | + TextColor="{AppThemeBinding |
| 52 | + Light={StaticResource DarkOnLightBackground}, |
| 53 | + Dark={StaticResource LightOnDarkBackground}}" |
| 54 | + FontSize="{OnIdiom 18, Phone=14}"/> |
| 55 | + <Label Text="{Binding Item, Converter={StaticResource ChartDataLabelConverter}, ConverterParameter='count'}" |
| 56 | + TextColor="{AppThemeBinding |
| 57 | + Light={StaticResource DarkOnLightBackground}, |
| 58 | + Dark={StaticResource LightOnDarkBackground}}" |
| 59 | + FontSize="{OnIdiom 18, Phone=14}"/> |
| 60 | + </HorizontalStackLayout> |
| 61 | + </DataTemplate> |
| 62 | + </chart:DoughnutSeries.LabelTemplate> |
| 63 | + |
| 64 | + <chart:DoughnutSeries.DataLabelSettings> |
| 65 | + <chart:CircularDataLabelSettings LabelPosition="Outside" |
| 66 | + SmartLabelAlignment="Shift"> |
| 67 | + <chart:CircularDataLabelSettings.ConnectorLineSettings> |
| 68 | + <chart:ConnectorLineStyle ConnectorType="Line" |
| 69 | + StrokeWidth="3"></chart:ConnectorLineStyle> |
| 70 | + </chart:CircularDataLabelSettings.ConnectorLineSettings> |
| 71 | + </chart:CircularDataLabelSettings> |
| 72 | + </chart:DoughnutSeries.DataLabelSettings> |
| 73 | + </chart:DoughnutSeries> |
48 | 74 | </chart:SfCircularChart> |
49 | 75 | </shimmer:SfShimmer.Content> |
50 | 76 | </shimmer:SfShimmer> |
|
0 commit comments