|
| 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:viewModel="clr-namespace:ChartAxisDemo" |
| 6 | + x:Class="ChartAxisDemo.MainPage"> |
| 7 | + |
| 8 | + <Grid> |
| 9 | + <chart:SfCartesianChart Title="Axis elements customization"> |
| 10 | + <chart:SfCartesianChart.BindingContext> |
| 11 | + <viewModel:ViewModel /> |
| 12 | + </chart:SfCartesianChart.BindingContext> |
| 13 | + |
| 14 | + <chart:SfCartesianChart.Resources> |
| 15 | + <chart:ChartAxisLabelStyle x:Key="axisLableStyle" TextColor="Red"/> |
| 16 | + <chart:ChartLineStyle x:Key="axisLineStyle" Stroke="Yellow" /> |
| 17 | + <chart:ChartLineStyle x:Key="majorLineStyle" Stroke="Brown"/> |
| 18 | + <chart:ChartAxisTickStyle x:Key="majorTickStyle" Stroke="Brown"/> |
| 19 | + <chart:ChartLineStyle x:Key="minorLineStyle" Stroke="Gray"/> |
| 20 | + <chart:ChartAxisTickStyle x:Key="minorTickStyle" Stroke="Gray"/> |
| 21 | + </chart:SfCartesianChart.Resources> |
| 22 | + |
| 23 | + <chart:SfCartesianChart.XAxes> |
| 24 | + <chart:CategoryAxis AxisLineStyle="{StaticResource axisLineStyle}" |
| 25 | + LabelStyle="{StaticResource axisLableStyle}" |
| 26 | + MajorGridLineStyle="{StaticResource majorLineStyle}" |
| 27 | + MajorTickStyle="{StaticResource majorTickStyle}" /> |
| 28 | + </chart:SfCartesianChart.XAxes> |
| 29 | + |
| 30 | + <chart:SfCartesianChart.YAxes> |
| 31 | + <chart:NumericalAxis MinorTicksPerInterval="2" |
| 32 | + Minimum="0" |
| 33 | + AxisLineStyle="{StaticResource axisLineStyle}" |
| 34 | + LabelStyle="{StaticResource axisLableStyle}" |
| 35 | + MajorGridLineStyle="{StaticResource majorLineStyle}" |
| 36 | + MajorTickStyle="{StaticResource majorTickStyle}" |
| 37 | + MinorGridLineStyle="{StaticResource minorLineStyle}" |
| 38 | + MinorTickStyle="{StaticResource minorTickStyle}" /> |
| 39 | + </chart:SfCartesianChart.YAxes> |
| 40 | + |
| 41 | + <chart:SplineSeries XBindingPath="XValue" |
| 42 | + YBindingPath="YValue" |
| 43 | + ItemsSource="{Binding Data}"/> |
| 44 | + |
| 45 | + </chart:SfCartesianChart> |
| 46 | + </Grid> |
| 47 | + |
| 48 | +</ContentPage> |
0 commit comments