JobDocumentStatusChart.xaml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <UserControl x:Class="PRSDesktop.JobDocumentStatusChart"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PRSDesktop"
  7. xmlns:sf="http://schemas.syncfusion.com/wpf"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition x:Name="ChartRow" Height="*"/>
  13. <RowDefinition x:Name="LabelRow" Height="0"/>
  14. </Grid.RowDefinitions>
  15. <sf:SfChart x:Name="Chart" Grid.Row="0">
  16. <sf:SfChart.Legend>
  17. <sf:ChartLegend x:Name="Legend"
  18. Orientation="Vertical"
  19. DockPosition="Floating">
  20. <sf:ChartLegend.ItemTemplate>
  21. <DataTemplate>
  22. <StackPanel Margin="10,0,10,0" Orientation="Horizontal">
  23. <Rectangle Width="10" Height="10" Margin="2" Fill="{Binding Colour}"/>
  24. <TextBlock HorizontalAlignment="Center"
  25. Margin="5,0,0,0"
  26. VerticalAlignment="Center"
  27. Text="{Binding Text}"/>
  28. </StackPanel>
  29. </DataTemplate>
  30. </sf:ChartLegend.ItemTemplate>
  31. </sf:ChartLegend>
  32. </sf:SfChart.Legend>
  33. <sf:SfChart.Resources>
  34. <Style TargetType="Path" x:Key="style">
  35. <Setter Property="Stroke" Value="Black"/>
  36. <Setter Property="Fill" Value="White"/>
  37. <Setter Property="StrokeThickness" Value="2"/>
  38. </Style>
  39. </sf:SfChart.Resources>
  40. <sf:SfChart.Behaviors>
  41. <sf:ChartTooltipBehavior Style="{StaticResource style}"/>
  42. </sf:SfChart.Behaviors>
  43. <sf:PieSeries x:Name="Pie" XBindingPath="Group" YBindingPath="Count" SegmentColorPath="Colour"
  44. ShowTooltip="True"
  45. sf:ChartTooltip.ShowDuration="5000">
  46. <sf:PieSeries.TooltipTemplate>
  47. <DataTemplate>
  48. <TextBlock Background="White">
  49. <Run Text="{Binding Item.MileStoneCode}"/>
  50. <Run Text=":"/>
  51. <Run Text="{Binding Item.Status}"/>
  52. <LineBreak/>
  53. <Run Text="{Binding Item.Count}"/>
  54. <Run Text="Items"/>
  55. </TextBlock>
  56. </DataTemplate>
  57. </sf:PieSeries.TooltipTemplate>
  58. <sf:PieSeries.AdornmentsInfo>
  59. <sf:ChartAdornmentInfo ShowLabel="True"
  60. SegmentLabelContent="LabelContentPath">
  61. <sf:ChartAdornmentInfo.LabelTemplate>
  62. <DataTemplate>
  63. <TextBlock>
  64. <Run Text="{Binding Item.MileStoneCode}"/>
  65. <Run Text=":"/>
  66. <Run Text="{Binding Item.Status}"/>
  67. </TextBlock>
  68. </DataTemplate>
  69. </sf:ChartAdornmentInfo.LabelTemplate>
  70. </sf:ChartAdornmentInfo>
  71. </sf:PieSeries.AdornmentsInfo>
  72. </sf:PieSeries>
  73. </sf:SfChart>
  74. <Label x:Name="NoDataLabel" Grid.Row="1"
  75. HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
  76. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  77. FontSize="30" Foreground="LightGray"/>
  78. </Grid>
  79. </UserControl>