|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 4 | + xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts" |
| 5 | + xmlns:model="clr-namespace:MarketCap" |
| 6 | + x:Class="MarketCap.MainPage"> |
| 7 | + |
| 8 | + <Border Margin="25" Padding="{OnPlatform Default=8, Android=7,iOS=7}" StrokeThickness="3" Stroke="Gray" StrokeShape="RoundRectangle 15"> |
| 9 | + <chart:SfCartesianChart HorizontalOptions="Fill" VerticalOptions="FillAndExpand"> |
| 10 | + <chart:SfCartesianChart.Resources> |
| 11 | + <ResourceDictionary> |
| 12 | + <x:String x:Key="UpTrendIcon">M3.2999878,20.999992 L3.2999878,31.099993 0,31.099993 0,24.300009z |
| 13 | + M7.4000244,16.900018 L7.4000244,31.099993 4.0999756,31.099993 4.0999756,20.30001z |
| 14 | + M16.400024,16.499994 L18.599976,18.700004 19.700012,17.599998 19.700012,31.099993 16.400024,31.099993z |
| 15 | + M23.799988,13.600001 L23.799988,31.199999 20.5,31.199999 20.5,16.900018z |
| 16 | + M11.5,12.800013 L11.5,31.099993 8.2000122,31.099993 8.2000122,16.1z |
| 17 | + M12.299988,12.400019 L15.599976,15.700006 15.599976,31.099993 12.299988,31.099993z |
| 18 | + M27.900024,9.499996 L27.900024,31.199999 24.599976,31.199999 24.599976,12.800013z |
| 19 | + M28.700012,9.1000021 L29,9.1000021 32,12.100001 32,31.099993 28.700012,31.099993z |
| 20 | + M31.400024,0 L31.099976,7.2000096 28.900024,4.9999983 18.200012,15.700006 |
| 21 | + 17.900024,15.999993 11.700012,9.8000143 0.70001221,20.80001 0.70001221,15.800012 |
| 22 | + 11.599976,4.8000167 17.900024,11.100002 26.400024,2.6000052 24.200012,0.4000244z</x:String> |
| 23 | + </ResourceDictionary> |
| 24 | + </chart:SfCartesianChart.Resources> |
| 25 | + <chart:SfCartesianChart.Title> |
| 26 | + <Grid> |
| 27 | + <Grid.RowDefinitions> |
| 28 | + <RowDefinition Height="{OnPlatform Android=68,Default=80,iOS=68}"/> |
| 29 | + </Grid.RowDefinitions> |
| 30 | + <Grid.ColumnDefinitions> |
| 31 | + <ColumnDefinition Width="55"/> |
| 32 | + <ColumnDefinition Width="Auto"/> |
| 33 | + </Grid.ColumnDefinitions> |
| 34 | + |
| 35 | + <Path Data="{StaticResource UpTrendIcon}" Fill="#FF000000" Margin="10,15,10,0"> |
| 36 | + <Path.RenderTransform> |
| 37 | + <TransformGroup> |
| 38 | + <TransformGroup.Children> |
| 39 | + <RotateTransform Angle="0"/> |
| 40 | + <ScaleTransform ScaleX="1" ScaleY="1"/> |
| 41 | + </TransformGroup.Children> |
| 42 | + </TransformGroup> |
| 43 | + </Path.RenderTransform> |
| 44 | + </Path> |
| 45 | + <StackLayout Grid.Column="1" Grid.Row="0" Margin="7,7,0,0"> |
| 46 | + <Label Text="Visualizing Country GDP and Market Cap Through Public Companies" FontSize="{OnPlatform Android=12,Default=20,iOS=12}" FontAttributes="Bold" TextColor="Black"/> |
| 47 | + <Label Text="Detailed Analysis Highlighting Market Capitalization, GDP, and the Number of Publicly Listed Companies" FontSize="{OnPlatform Android=10,Default=16,iOS=10}" TextColor="Black" Margin="0,2,0,0"/> |
| 48 | + </StackLayout> |
| 49 | + </Grid> |
| 50 | + </chart:SfCartesianChart.Title> |
| 51 | + |
| 52 | + <chart:SfCartesianChart.BindingContext> |
| 53 | + <model:MarketCapViewModel/> |
| 54 | + </chart:SfCartesianChart.BindingContext> |
| 55 | + |
| 56 | + <chart:SfCartesianChart.TooltipBehavior> |
| 57 | + <chart:ChartTooltipBehavior/> |
| 58 | + </chart:SfCartesianChart.TooltipBehavior> |
| 59 | + |
| 60 | + <chart:SfCartesianChart.XAxes> |
| 61 | + <chart:NumericalAxis Minimum="0" Maximum="400" ShowMajorGridLines="False"> |
| 62 | + <chart:NumericalAxis.Title> |
| 63 | + <chart:ChartAxisTitle Text="Countries GDP Levels"/> |
| 64 | + </chart:NumericalAxis.Title> |
| 65 | + <chart:NumericalAxis.LabelStyle> |
| 66 | + <chart:ChartAxisLabelStyle TextColor="Black"/> |
| 67 | + </chart:NumericalAxis.LabelStyle> |
| 68 | + <chart:NumericalAxis.AxisLineStyle> |
| 69 | + <chart:ChartLineStyle Stroke="black"/> |
| 70 | + </chart:NumericalAxis.AxisLineStyle> |
| 71 | + <chart:NumericalAxis.MajorTickStyle> |
| 72 | + <chart:ChartAxisTickStyle Stroke="black"/> |
| 73 | + </chart:NumericalAxis.MajorTickStyle> |
| 74 | + </chart:NumericalAxis> |
| 75 | + </chart:SfCartesianChart.XAxes> |
| 76 | + |
| 77 | + <chart:SfCartesianChart.YAxes> |
| 78 | + <chart:NumericalAxis Minimum="0" Maximum="6000" Interval="1000" ShowMajorGridLines="False" LabelCreated="OnLabelCreated" PlotOffsetStart="10"> |
| 79 | + <chart:NumericalAxis.Title> |
| 80 | + <chart:ChartAxisTitle Text="No of Companies"/> |
| 81 | + </chart:NumericalAxis.Title> |
| 82 | + <chart:NumericalAxis.LabelStyle> |
| 83 | + <chart:ChartAxisLabelStyle TextColor="Black"/> |
| 84 | + </chart:NumericalAxis.LabelStyle> |
| 85 | + <chart:NumericalAxis.AxisLineStyle> |
| 86 | + <chart:ChartLineStyle Stroke="black"/> |
| 87 | + </chart:NumericalAxis.AxisLineStyle> |
| 88 | + <chart:NumericalAxis.MajorTickStyle> |
| 89 | + <chart:ChartAxisTickStyle Stroke="black"/> |
| 90 | + </chart:NumericalAxis.MajorTickStyle> |
| 91 | + </chart:NumericalAxis> |
| 92 | + </chart:SfCartesianChart.YAxes> |
| 93 | + |
| 94 | + <model:BubbleExt XBindingPath="Gdp" MaximumRadius="{OnPlatform Android=28, Default=50, iOS=28}" MinimumRadius="5" EnableTooltip="True" |
| 95 | + YBindingPath="Company" SizeValuePath="Size" Stroke="Black" StrokeWidth="2" |
| 96 | + ItemsSource="{Binding MarketCapData}" |
| 97 | + EnableAnimation="True"> |
| 98 | + |
| 99 | + <chart:BubbleSeries.TooltipTemplate> |
| 100 | + <DataTemplate> |
| 101 | + <Grid BackgroundColor="Black"> |
| 102 | + <Grid.RowDefinitions> |
| 103 | + <RowDefinition Height="Auto"/> |
| 104 | + <RowDefinition Height="Auto"/> |
| 105 | + <RowDefinition Height="Auto"/> |
| 106 | + </Grid.RowDefinitions> |
| 107 | + <Grid.ColumnDefinitions> |
| 108 | + <ColumnDefinition Width="Auto"/> |
| 109 | + </Grid.ColumnDefinitions> |
| 110 | + <Grid Grid.Row="0" Grid.Column="0" Margin="3,5,10,3"> |
| 111 | + <HorizontalStackLayout HorizontalOptions="Center"> |
| 112 | + <Label Text="{Binding Item.Name}" FontSize="18" TextColor="White" HorizontalTextAlignment="Center" Margin="0,0,0,0"/> |
| 113 | + </HorizontalStackLayout> |
| 114 | + </Grid> |
| 115 | + <BoxView Grid.Row="1" Grid.Column="0" VerticalOptions="Center" BackgroundColor="White" HeightRequest="1"/> |
| 116 | + <Grid Grid.Row="2" Grid.Column="0" Margin="3,5,10,3"> |
| 117 | + <StackLayout> |
| 118 | + <Label Text="{Binding Item.Gdp,StringFormat='GDP : {0} '}" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="Start"/> |
| 119 | + <Label Text="{Binding Item.Company,StringFormat='Companies listed : {0} '}" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="Start"/> |
| 120 | + <Label Text="{Binding Item.Size,StringFormat='Market Cap : € {0} B '}" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="Start"/> |
| 121 | + </StackLayout> |
| 122 | + </Grid> |
| 123 | + </Grid> |
| 124 | + </DataTemplate> |
| 125 | + </chart:BubbleSeries.TooltipTemplate> |
| 126 | + </model:BubbleExt> |
| 127 | + </chart:SfCartesianChart> |
| 128 | + </Border> |
| 129 | +</ContentPage> |
0 commit comments