I've created SfChart within a UserControl element, and I try to align the SfChart so it will be in the middle of the UserControl or even fill all the UserControl.
The SfChart is still aligned to top right corner regardless of any changes I make.
The UserControl will be added into a RibbonWindow.
UserControl xaml:
<UserControl x:Class="WX.UserControl1"
xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WX"
xmlns:syncfusion="
http://schemas.syncfusion.com/wpf"
xmlns:mc="
http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="
http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Name="main">
<Grid >
<syncfusion:SfChart x:Name="chart1" HorizontalAlignment="Center" VerticalAlignment="Center" >
<syncfusion:SfChart.PrimaryAxis>
<syncfusion:NumericalAxis Name="xAxis" Visibility="Hidden" />
</syncfusion:SfChart.PrimaryAxis>
<syncfusion:SfChart.SecondaryAxis >
<syncfusion:NumericalAxis Name="yAxis" Visibility="Hidden" />
</syncfusion:SfChart.SecondaryAxis>
<syncfusion:FastLineSeries Name="chr" MouseMove="chart1_MouseMove" ItemsSource="{Binding measurments}" Interior="Blue" SortDirection="Ascending" ListenPropertyChange="True" XBindingPath="X" YBindingPath="Y" />
</syncfusion:SfChart>
</Grid>
</UserControl>
RibbonWindow xaml:
<DockPanel Name="dll" Grid.Row="1" Grid.ColumnSpan="3" >
</DockPanel>
UserControl will be added into the DockPanel.
How the RibbonWindow looks like: (Aligned to the top right corner)
How can I fixed it so the SfChart would be in the middle of the UserControl (or fill it).
Regards,
Dov.