|
| 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 | + x:Class="VarianceIndicators.MainPage" |
| 5 | + xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Toolkit.Charts;assembly=Syncfusion.Maui.Toolkit" |
| 6 | + xmlns:local="clr-namespace:VarianceIndicators"> |
| 7 | + |
| 8 | + <ContentPage.BindingContext> |
| 9 | + <local:ChartViewModel /> |
| 10 | + </ContentPage.BindingContext> |
| 11 | + |
| 12 | + <ContentPage.Resources> |
| 13 | + <x:String x:Key="PathData" >M24,17.000001L24,26.000002 27,26.000002 27,17.000001z M22,15.000001L29,15.000001 29,28.000002 22,28.000002z M6,14.000001L6,26.000002 9,26.000002 9,14.000001z M4,12.000001L11,12.000001 11,28.000002 4,28.000002z M15,4.0000005L15,26 18,26 18,4.0000005z M13,2.0000005L20,2.0000005 20,28 13,28z M0,0L2,0 2,30 32,30 32,32 0,32z</x:String> |
| 14 | + </ContentPage.Resources> |
| 15 | + |
| 16 | + |
| 17 | + <Border Margin="{OnPlatform Android=10,Default=25,iOS=10}" |
| 18 | + StrokeThickness="1" Stroke="Black" |
| 19 | + StrokeShape="RoundRectangle 15"> |
| 20 | + |
| 21 | + <syncfusion:SfCartesianChart HorizontalOptions="Fill" |
| 22 | + VerticalOptions="Fill" |
| 23 | + Margin="{OnPlatform Android=5,Default=15,iOS=5}"> |
| 24 | + <syncfusion:SfCartesianChart.Resources> |
| 25 | + <DataTemplate x:Key="tooltipTemplate" > |
| 26 | + <Border BackgroundColor="#7bb4eb" |
| 27 | + Padding="8, 3, 8, 3" |
| 28 | + Stroke="Transparent"> |
| 29 | + <StackLayout Orientation="Horizontal"> |
| 30 | + <Label Text="{Binding Item.Year, StringFormat='{}{0:yyyy}'}" |
| 31 | + TextColor="Black" |
| 32 | + FontSize="14" |
| 33 | + HorizontalOptions="Center" |
| 34 | + VerticalOptions="Center"/> |
| 35 | + <Label Text=" : " |
| 36 | + TextColor="Black" |
| 37 | + FontAttributes="Bold" |
| 38 | + FontSize="14" |
| 39 | + HorizontalOptions="Center" |
| 40 | + VerticalOptions="Center"/> |
| 41 | + <BoxView WidthRequest="5" |
| 42 | + BackgroundColor="Transparent"/> |
| 43 | + <Label Text="{Binding Item.YValue}" |
| 44 | + TextColor="Black" |
| 45 | + FontSize="14" |
| 46 | + HorizontalOptions="Center" |
| 47 | + VerticalOptions="Center"/> |
| 48 | + </StackLayout> |
| 49 | + </Border> |
| 50 | + </DataTemplate> |
| 51 | + </syncfusion:SfCartesianChart.Resources> |
| 52 | + <syncfusion:SfCartesianChart.Title> |
| 53 | + <Grid Padding="35,0,0,10"> |
| 54 | + <Grid.ColumnDefinitions> |
| 55 | + <ColumnDefinition Width="Auto"/> |
| 56 | + <ColumnDefinition Width="*" /> |
| 57 | + </Grid.ColumnDefinitions> |
| 58 | + <Path Grid.Column="0" |
| 59 | + Data="{StaticResource PathData}" |
| 60 | + Fill="Black" |
| 61 | + Stroke="Gray" |
| 62 | + StrokeThickness="1" |
| 63 | + HeightRequest="40" |
| 64 | + WidthRequest="40" |
| 65 | + VerticalOptions="Center"/> |
| 66 | + |
| 67 | + <StackLayout Grid.Column="1" Orientation="Vertical" HorizontalOptions="Start"> |
| 68 | + <Label Text="Building Variance Indicators in .NET MAUI Toolkit Charts to Visualize Natural Gas Price Volatility" |
| 69 | + FontAttributes="Bold" |
| 70 | + FontSize="{OnPlatform Android=12,Default=16,iOS=12}" /> |
| 71 | + <Label Text="Natural Gas Price Volatility Analysis 2014-2024" |
| 72 | + FontSize="{OnPlatform Android=10,Default=12,iOS=10}" /> |
| 73 | + </StackLayout> |
| 74 | + </Grid> |
| 75 | + </syncfusion:SfCartesianChart.Title> |
| 76 | + |
| 77 | + <syncfusion:SfCartesianChart.TooltipBehavior> |
| 78 | + <syncfusion:ChartTooltipBehavior Background="#7bb4eb" /> |
| 79 | + </syncfusion:SfCartesianChart.TooltipBehavior> |
| 80 | + |
| 81 | + <syncfusion:SfCartesianChart.XAxes> |
| 82 | + <syncfusion:DateTimeAxis Interval="2" IntervalType="Years" > |
| 83 | + <syncfusion:DateTimeAxis.Title> |
| 84 | + <syncfusion:ChartAxisTitle Text="Time Period (Years)" /> |
| 85 | + </syncfusion:DateTimeAxis.Title> |
| 86 | + <syncfusion:DateTimeAxis.AxisLineStyle> |
| 87 | + <syncfusion:ChartLineStyle Stroke="#888888"/> |
| 88 | + </syncfusion:DateTimeAxis.AxisLineStyle> |
| 89 | + </syncfusion:DateTimeAxis> |
| 90 | + </syncfusion:SfCartesianChart.XAxes> |
| 91 | + |
| 92 | + <syncfusion:SfCartesianChart.YAxes> |
| 93 | + <syncfusion:NumericalAxis Maximum="5.5" Interval="1" > |
| 94 | + <syncfusion:NumericalAxis.Title> |
| 95 | + <syncfusion:ChartAxisTitle Text="Price (USD per Million BTU)" /> |
| 96 | + </syncfusion:NumericalAxis.Title> |
| 97 | + <syncfusion:NumericalAxis.MajorGridLineStyle> |
| 98 | + <syncfusion:ChartLineStyle StrokeWidth="{OnPlatform Android=0.0,iOS=0.0}" /> |
| 99 | + </syncfusion:NumericalAxis.MajorGridLineStyle> |
| 100 | + </syncfusion:NumericalAxis> |
| 101 | + </syncfusion:SfCartesianChart.YAxes> |
| 102 | + |
| 103 | + <syncfusion:SfCartesianChart.Series> |
| 104 | + <syncfusion:ColumnSeries ItemsSource="{Binding Data}" |
| 105 | + Spacing="{OnPlatform Android=0.5,iOS=0.5}" |
| 106 | + XBindingPath="Year" |
| 107 | + YBindingPath="YValue" |
| 108 | + EnableTooltip="True" |
| 109 | + Fill="#7bb4eb" |
| 110 | + ShowDataLabels="False" |
| 111 | + TooltipTemplate="{StaticResource tooltipTemplate}"> |
| 112 | + </syncfusion:ColumnSeries> |
| 113 | + <local:RangeColumnSeriesExt ItemsSource="{Binding Data}" |
| 114 | + XBindingPath="Year" |
| 115 | + High="High" |
| 116 | + Low="Low" /> |
| 117 | + </syncfusion:SfCartesianChart.Series> |
| 118 | + </syncfusion:SfCartesianChart> |
| 119 | + </Border> |
| 120 | +</ContentPage> |
0 commit comments