This is a migrated thread and some comments may be shown as answers.

Hidden axis with zoom

3 Answers 24 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 26 Nov 2013, 08:06 PM
How can I hide all axis labels and ticks and still have the zoom bar showing?

Setting the axis visibility hides both, setting labels and and tick colors to transparent still incurs a perf penalty.

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 28 Nov 2013, 08:09 AM
Hi Charlie,

Can you confirm that you need a solution with the RadChart? We strongly suggest that you use the new RadChartView and not the old RadChart, because the new control is much much faster, it is more flexible and easier to set up.

With the new RadCartesianChart the desired effect can easily be achieved by setting the ShowLabels and MajorTickOffset properties of the axis. With the old RadChart you can set the properties of the axis like this:
this.chart1.DefaultView.ChartArea.AxisX.MajorTicksVisibility = System.Windows.Visibility.Collapsed;
this.chart1.DefaultView.ChartArea.AxisX.AxisLabelsVisibility = System.Windows.Visibility.Collapsed;

Regards,
Petar Marchev
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Charlie
Top achievements
Rank 1
answered on 02 Dec 2013, 03:06 PM
Yes, you are correct I am using the ChartView not Chart. I did not notice there were separate forums.

Setting ShowLabels="False" eliminates the labels, what is the setting for MajorTickOffset to eliminate ticks? And can you point to where it specifies this in the documentation?
0
Petar Marchev
Telerik team
answered on 02 Dec 2013, 05:24 PM
Hi Charlie,

The chart does not have API for hiding the ticks. The MajorTickOffset is a simple work-around for this. The purpose of the MajorTickOffset property is to offset the ticks - say you have an axis with range from 0 to 10 with step 1. You would have 11 ticks total, the first one starting from 0. If you set the MajorTickOffset to 3, then you would have 8 ticks, the first starting from 3.

So if you set the property to a large enough number - no ticks will be plotted. Give it a try and see how it goes. Alternatively you can use the  MajorTickTemplate and set an empty DataTemplate so that the ticks will not be visible.

Regards,
Petar Marchev
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Chart
Asked by
Charlie
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Charlie
Top achievements
Rank 1
Share this question
or