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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide axis line

Thread ID:

Created:

Updated:

Platform:

Replies:

142113 Jan 21,2019 05:22 AM UTC Jan 22,2019 12:25 PM UTC Xamarin.Forms 3
loading
Tags: SfChart
Mikolaj Kieres
Asked On January 21, 2019 05:22 AM UTC

Hi,

I would like to ask how to hide an axis line? I need to achieve what's on the left of the below screen and I currently have what's on the right side. Could anyone point me in the right direction or answer if removing axis line is even possible (shown by the arrows)?



Thanks a lot
Mikolaj

Bharathiraja K [Syncfusion]
Replied On January 21, 2019 07:35 AM UTC

Hi Mikolaj, 
 
Greetings from Syncfusion, we can achieve your requirement by customizing chart axis AxisLineStyle’s StrokeColor property value as Transparent or by setting the StrokeWidth property value as 0(zero) of the chart axis. 
 
Please refer the below code snippet: 
CodeSnippet[c#]: 
NumericalAxis numericalAxis = new NumericalAxis(); 
numericalAxis.AxisLineStyle.StrokeColor = Color.Transparent;//Hide Axis line 
//numericalAxis.AxisLineStyle.StrokeWidth = 0;//Hide Axis line 
numericalAxis.MajorTickStyle.StrokeColor = Color.Transparent;//Hide TickLines 
//numericalAxis.MajorTickStyle.StrokeWidth = 0;//Hide TickLines 
 
CodeSnippet[XAML]: 
<chart:NumericalAxis> 
                    <chart:NumericalAxis.AxisLineStyle> 
                        <chart:ChartLineStyle StrokeColor="Transparent"/> 
                    </chart:NumericalAxis.AxisLineStyle> 
                    <chart:NumericalAxis.MajorTickStyle> 
                        <chart:ChartAxisTickStyle StrokeColor="Transparent"/> 
                    </chart:NumericalAxis.MajorTickStyle> 
</chart:NumericalAxis> 
 
Please refer the below UG link for More details, 
https://help.syncfusion.com/xamarin/sfchart/axis#axis-line-customization  
 
Note: We have also included code to hide the TickLines of the axis to produce output as per the sample image. Please ignore the TickLines customization, if you don’t need. 
 
Thanks, 
Bharathiraja. 


Mikolaj Kieres
Replied On January 21, 2019 10:04 PM UTC

Hi Bharathiraja,

That worked perfectly! Thanks a lot for the quick response.

Cheers
Mikolaj

Bharathiraja K [Syncfusion]
Replied On January 22, 2019 12:25 PM UTC

Hi Mikolaj, 
 
Glad that the solution works. If you need any assistance, please contact us. 

Regards,
 
Bharathiraja 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;