Skip to content

Commit 09f0e5d

Browse files
authored
Merge pull request #569 from tj-devel709/dev/TJ/ChangeChart
Change the radial chart to doughnut chart
2 parents ab5bdb9 + 8942f06 commit 09f0e5d

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

9.0/Apps/DeveloperBalance/Pages/Controls/CategoryChart.xaml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,56 @@
77
xmlns:pageModels="clr-namespace:DeveloperBalance.PageModels"
88
x:Class="DeveloperBalance.Pages.Controls.CategoryChart"
99
HeightRequest="{OnIdiom 300, Phone=200}"
10-
Margin="0, 12"
11-
Style="{StaticResource CardStyle}"
12-
x:DataType="pageModels:MainPageModel">
10+
Style="{StaticResource CardStyle}">
1311
<shimmer:SfShimmer
1412
BackgroundColor="Transparent"
1513
VerticalOptions="FillAndExpand"
1614
IsActive ="{Binding IsBusy}">
1715
<shimmer:SfShimmer.CustomView>
1816
<Grid>
19-
<BoxView
17+
<BoxView
2018
CornerRadius="12"
2119
VerticalOptions="FillAndExpand"
2220
Style="{StaticResource ShimmerCustomViewStyle}"/>
2321
</Grid>
2422
</shimmer:SfShimmer.CustomView>
2523
<shimmer:SfShimmer.Content>
2624
<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
25+
<chart:DoughnutSeries
4026
ItemsSource="{Binding TodoCategoryData}"
4127
PaletteBrushes="{Binding TodoCategoryColors}"
4228
XBindingPath="Title"
43-
YBindingPath="Count"
29+
YBindingPath="Count"
4430
ShowDataLabels="True"
45-
EnableTooltip="True"
46-
TrackFill="{AppThemeBinding Light={StaticResource LightBackground}, Dark={StaticResource DarkBackground}}"
47-
CapStyle = "BothCurve"/>
31+
EnableTooltip="False"
32+
x:Name="doughnutSeries"
33+
Radius="{OnIdiom 0.7, Phone=0.5}"
34+
InnerRadius="0.7" >
35+
<chart:DoughnutSeries.LabelTemplate>
36+
<DataTemplate >
37+
<HorizontalStackLayout>
38+
<Label Text="{Binding Item.Title}" TextColor="{AppThemeBinding
39+
Light={StaticResource DarkOnLightBackground},
40+
Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/>
41+
<Label Text=" : " TextColor="{AppThemeBinding
42+
Light={StaticResource DarkOnLightBackground},
43+
Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/>
44+
<Label Text="{Binding Item.Count}" TextColor="{AppThemeBinding
45+
Light={StaticResource DarkOnLightBackground},
46+
Dark={StaticResource LightOnDarkBackground}}" FontSize="{OnIdiom 18, Phone=14}"/>
47+
</HorizontalStackLayout>
48+
</DataTemplate>
49+
</chart:DoughnutSeries.LabelTemplate>
50+
51+
<chart:DoughnutSeries.DataLabelSettings>
52+
<chart:CircularDataLabelSettings LabelPosition="Outside" SmartLabelAlignment="Shift">
53+
<chart:CircularDataLabelSettings.ConnectorLineSettings>
54+
<chart:ConnectorLineStyle ConnectorType="Line" StrokeWidth="3" ></chart:ConnectorLineStyle>
55+
</chart:CircularDataLabelSettings.ConnectorLineSettings>
56+
</chart:CircularDataLabelSettings>
57+
</chart:DoughnutSeries.DataLabelSettings>
58+
</chart:DoughnutSeries>
59+
4860
</chart:SfCircularChart>
4961
</shimmer:SfShimmer.Content>
5062
</shimmer:SfShimmer>

9.0/Apps/DeveloperBalance/Pages/MainPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<pullToRefresh:SfPullToRefresh.PullableContent>
3636
<ScrollView>
3737
<VerticalStackLayout Spacing="{StaticResource LayoutSpacing}" Padding="{StaticResource LayoutPadding}">
38+
<Label Text="Task Categories" Style="{StaticResource Title2}"/>
3839
<controls:CategoryChart />
3940
<Label Text="Projects" Style="{StaticResource Title2}"/>
4041
<ScrollView Orientation="Horizontal" Margin="-30,0">

0 commit comments

Comments
 (0)