|
| 1 | +<Window x:Class="WhealthDistributionSample.MainWindow" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:charts="clr-namespace:Syncfusion.UI.Xaml.Charts;assembly=Syncfusion.SfChart.WPF" |
| 7 | + xmlns:local="clr-namespace:WhealthDistributionSample" |
| 8 | + mc:Ignorable="d" |
| 9 | + Title="MainWindow" Height="640" Width="879" Background="Black"> |
| 10 | + |
| 11 | + <Window.Resources> |
| 12 | + <local:ValueConverter x:Key="ColorCoverter"/> |
| 13 | + </Window.Resources> |
| 14 | + |
| 15 | + <!--Border for the chart--> |
| 16 | + <Border Margin="20" BorderThickness="2" BorderBrush="White" CornerRadius="10" Padding="0,0,40,0"> |
| 17 | + |
| 18 | + <charts:SfChart x:Name="chart" Grid.Column="0" Palette="LightCandy" Margin="20,10,0,20" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalHeaderAlignment="Left"> |
| 19 | + <charts:SfChart.DataContext> |
| 20 | + <local:HouseHoldWealthData x:Name="viewModel"/> |
| 21 | + </charts:SfChart.DataContext> |
| 22 | + |
| 23 | + <charts:SfChart.Resources> |
| 24 | + |
| 25 | + <charts:NumericalAxis x:Key="yAxis" x:Name="YAxis" Interval="50000000" ActualRangeChanged="NumericalAxis_ActualRangeChanged" LabelCreated="NumericalAxis_LabelCreated" Maximum="146000000" > |
| 26 | + <charts:NumericalAxis.LabelStyle> |
| 27 | + <charts:LabelStyle Foreground="White"/> |
| 28 | + </charts:NumericalAxis.LabelStyle> |
| 29 | + <charts:NumericalAxis.AxisLineStyle> |
| 30 | + <Style TargetType="Line"> |
| 31 | + <Setter Property="StrokeThickness" Value="0"/> |
| 32 | + </Style> |
| 33 | + </charts:NumericalAxis.AxisLineStyle> |
| 34 | + |
| 35 | + </charts:NumericalAxis> |
| 36 | + |
| 37 | + </charts:SfChart.Resources> |
| 38 | + |
| 39 | + <charts:SfChart.Header> |
| 40 | + <Border> |
| 41 | + <Grid x:Name="header"> |
| 42 | + <Grid.ColumnDefinitions> |
| 43 | + <ColumnDefinition /> |
| 44 | + <ColumnDefinition Width="5*"/> |
| 45 | + </Grid.ColumnDefinitions> |
| 46 | + |
| 47 | + <Image Source="Wealth.png" Grid.Column="0" Margin="0,5,0,5" Width="70" Height="60"/> |
| 48 | + |
| 49 | + <StackPanel Grid.Column="1" Margin="5,2,0,0" HorizontalAlignment="Left" Orientation="Vertical"> |
| 50 | + <Label Content="A Comprehensive Analysis of Household Wealth Distribution" FontSize="22" FontFamily="AntaRegular" Foreground="White"/> |
| 51 | + <Label Content="in the US by Exploring Income Groups" FontSize="22" Margin="0,2,0,0" FontFamily="AntaRegular" Foreground="White"/> |
| 52 | + </StackPanel> |
| 53 | + </Grid> |
| 54 | + |
| 55 | + </Border> |
| 56 | + </charts:SfChart.Header> |
| 57 | + |
| 58 | + <charts:SfChart.PrimaryAxis> |
| 59 | + |
| 60 | + <charts:CategoryAxis Interval="25" ShowGridLines="False"> |
| 61 | + <charts:CategoryAxis.LabelStyle> |
| 62 | + <charts:LabelStyle Foreground="White"/> |
| 63 | + </charts:CategoryAxis.LabelStyle> |
| 64 | + </charts:CategoryAxis> |
| 65 | + |
| 66 | + </charts:SfChart.PrimaryAxis> |
| 67 | + |
| 68 | + <charts:SfChart.SecondaryAxis> |
| 69 | + |
| 70 | + <charts:NumericalAxis x:Name="customAxis" OpposedPosition="True" LabelsSource="{Binding Labels}" ContentPath="Content" PositionPath="Position" ShowGridLines="False" EdgeLabelsDrawingMode="Shift" TickLineSize="0" > |
| 71 | + |
| 72 | + <charts:NumericalAxis.AxisLineStyle> |
| 73 | + <Style TargetType="Line"> |
| 74 | + <Setter Property="StrokeThickness" Value="0"/> |
| 75 | + </Style> |
| 76 | + </charts:NumericalAxis.AxisLineStyle> |
| 77 | + |
| 78 | + <charts:NumericalAxis.LabelTemplate> |
| 79 | + <DataTemplate> |
| 80 | + <Border Width="70" Background="{Binding LabelContent, Converter= {StaticResource ColorCoverter}}"> |
| 81 | + <Label Content="{Binding LabelContent}" Foreground="Black" HorizontalContentAlignment="Center" FontWeight="SemiBold"/> |
| 82 | + </Border> |
| 83 | + </DataTemplate> |
| 84 | + </charts:NumericalAxis.LabelTemplate> |
| 85 | + |
| 86 | + </charts:NumericalAxis> |
| 87 | + |
| 88 | + </charts:SfChart.SecondaryAxis> |
| 89 | + |
| 90 | + <charts:SfChart.Annotations> |
| 91 | + <charts:TextAnnotation CoordinateUnit="Axis" Y1="100000000" X1="70.60" > |
| 92 | + <charts:TextAnnotation.ContentTemplate> |
| 93 | + <DataTemplate> |
| 94 | + <StackPanel> |
| 95 | + <TextBlock Text="The share of wealth held by the top 0.1% has reached its highest point to date" Foreground="White" FontSize="10" FontWeight="Medium" Width="105" Height="60" TextAlignment="Justify" TextWrapping="Wrap"/> |
| 96 | + </StackPanel> |
| 97 | + </DataTemplate> |
| 98 | + </charts:TextAnnotation.ContentTemplate> |
| 99 | + |
| 100 | + </charts:TextAnnotation> |
| 101 | + <charts:TextAnnotation CoordinateUnit="Axis" Y1="18000000" X1="75.60" > |
| 102 | + <charts:TextAnnotation.ContentTemplate> |
| 103 | + <DataTemplate> |
| 104 | + <StackPanel> |
| 105 | + <TextBlock Text="In 2011, the bottom 50% reached a historically low share of wealth, at just 0.4%" Foreground="Black" FontSize="10" FontWeight="Medium" Width="135" Height="50" TextAlignment="Justify" TextWrapping="Wrap"/> |
| 106 | + </StackPanel> |
| 107 | + </DataTemplate> |
| 108 | + </charts:TextAnnotation.ContentTemplate> |
| 109 | + |
| 110 | + </charts:TextAnnotation> |
| 111 | + </charts:SfChart.Annotations> |
| 112 | + |
| 113 | + <charts:StackingAreaSeries ItemsSource="{Binding Bottom50Data}" YAxis="{StaticResource yAxis}" XBindingPath="Date" YBindingPath="Value" Interior="#A94438" > |
| 114 | + </charts:StackingAreaSeries> |
| 115 | + <charts:StackingAreaSeries ItemsSource="{Binding Next40}" YAxis="{StaticResource yAxis}" XBindingPath="Date" YBindingPath="Value" Interior="#CD5C08"> |
| 116 | + </charts:StackingAreaSeries> |
| 117 | + <charts:StackingAreaSeries ItemsSource="{Binding Top9}" YAxis="{StaticResource yAxis}" XBindingPath="Date" YBindingPath="Value" Interior="#E8C872"> |
| 118 | + </charts:StackingAreaSeries> |
| 119 | + <charts:StackingAreaSeries ItemsSource="{Binding Top1}" YAxis="{StaticResource yAxis}" XBindingPath="Date" YBindingPath="Value" Interior="#BBE2EC" > |
| 120 | + </charts:StackingAreaSeries> |
| 121 | + <charts:StackingAreaSeries ItemsSource="{Binding TopPoint1}" YAxis="{StaticResource yAxis}" XBindingPath="Date" YBindingPath="Value" Interior="#DFF5FF"> |
| 122 | + </charts:StackingAreaSeries> |
| 123 | + |
| 124 | + </charts:SfChart> |
| 125 | + |
| 126 | + </Border> |
| 127 | + |
| 128 | + |
| 129 | +</Window> |
0 commit comments