We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reduce the margin between the axis, title and border

How do I reduce the space marked by the red rectangles on both axis? .  Thank you.

1 Reply

MP Michael Prabhu M Syncfusion Team December 11, 2018 12:17 PM UTC

Hi Albert K, 

Greetings from Syncfusion. You can resolve “margin between axis” by setting the Margin and BorderWidth as Zero to the ChartAxis LabelStyle and Title for respective axis. And also, you can resolve “margin between chart and rangenavigator” by setting Chart, RangeNavigator Margin and StackLayout Padding and Spacing as Zero.  Please refer below code snippet. 

Code Snippet[C#] 

Chart.PrimaryAxis = new DateTimeAxis(); 
Chart.PrimaryAxis.Title.Text = "Date"; 
Chart.PrimaryAxis.Title.Margin = new Thickness(0); 
Chart.PrimaryAxis.Title.BorderWidth = 0; 
Chart.PrimaryAxis.LabelStyle.Margin = new Thickness(0); 
Chart.PrimaryAxis.LabelStyle.BorderThickness = new Thickness(0); 
Chart.SecondaryAxis = new NumericalAxis(); 
Chart.SecondaryAxis.Title.Text = "Pressure"; 
Chart.SecondaryAxis.Title.Margin = new Thickness(0); 
Chart.SecondaryAxis.Title.BorderWidth = 0; 
Chart.SecondaryAxis.LabelStyle.Margin = new Thickness(0); 
Chart.SecondaryAxis.LabelStyle.BorderThickness = new Thickness(0); 
RangeNavigator.Margin = 0; 
Chart.Margin = 0; 
Layout.Padding = 0; 
Layout.Spacing = 0; 

And we have prepared a sample for your requirement and you can download the sample from the below link. 




Live Chat Icon For mobile
Up arrow icon