- Home
- Forum
- Xamarin.Forms
- Hide axis line
Hide axis line
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
SIGN IN To post a reply.
3 Replies
BK
Bharathiraja K
Syncfusion Team
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.
MK
Mikolaj Kieres
January 21, 2019 10:04 PM UTC
Hi Bharathiraja,
That worked perfectly! Thanks a lot for the quick response.
Cheers
Mikolaj
BK
Bharathiraja K
Syncfusion Team
January 22, 2019 12:25 PM UTC
Hi Mikolaj,
Glad that the solution works. If you need any assistance, please contact us.
Regards,
Bharathiraja
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
MK Mikolaj Kieres
- Jan 21, 2019 05:22 AM UTC
- Jan 22, 2019 12:25 PM UTC