This is a migrated thread and some comments may be shown as answers.
Hiding the x and y axis
1 Answer 39 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Matt asked on 07 Jul 2016, 07:21 PM
I don't want to show the x or y axis. I see that you can turn off the labels easily and set the color, but it doesn't look like you can set the visibility. I set the LineColor to white to try to imitate hiding the axis but that doesn't hide the little tick marks:
chart.HorizontalAxis.ShowLabels = false;
chart.VerticalAxis.ShowLabels = false;
chart.HorizontalAxis.LineColor = Color.White;
chart.VerticalAxis.LineColor = Color.White;

See the attachment to see the little grey tick marks at the bottom even though the axes are set to white.

Is there a way to make the axes invisible?

1 Answer, 1 is accepted

Sort by
Rosy Topchiyska
Telerik team
answered on 13 Jul 2016, 07:03 AM
Hello Matt,

Thank you for contacting us.

The chart does not provide styling mechanism for the axis ticks, but the desired look can be easily achieved with a custom chart renderer.

I have attached a sample to demonstrate this. Please, take a look at the AppDelegate.cs file. The CustomChartRenderer inherits from the default CartesianChartRenderer class and updates the chart axes whenever the chart or its axes are updated.

Also, don't forget to use the custom renderer in the ExportRenderer attribute:
[assembly: ExportRenderer(typeof(RadCartesianChart), typeof(CustomChartRenderer))]

 I hope this helps. Please, let us know if you have further questions.

Rosy Topchiyska
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question