Hidden axis with zoom

4 posts, 0 answers
  1. Charlie
    Charlie avatar
    13 posts
    Member since:
    Apr 2013

    Posted 26 Nov 2013 Link to this post

    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.
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 28 Nov 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Charlie
    Charlie avatar
    13 posts
    Member since:
    Apr 2013

    Posted 02 Dec 2013 Link to this post

    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?
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 02 Dec 2013 Link to this post

    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 >>
Back to Top