How to hide X-Axis Scale?

4 posts, 0 answers
  1. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2012 Link to this post

    Hello Team,

    We are using RadChart control to show the Revenue.We are showing 2 series like VTB and YOY.I am able to get data and showed in graph.

    I have a requirement like hiding the X-Axis scale values.To acieve that i have commented out DataPointMember code but "1" displayed
    in X-Axis scale.

                        SeriesMapping objSeriesMapping3 = new SeriesMapping();

                        objSeriesMapping3.LegendLabel = "VTB %";
                        objSeriesMapping3.SeriesDefinition = BarDefVTBQTD;

                        objSeriesMapping3.SeriesDefinition.Appearance.Fill = new SolidColorBrush(Color.FromArgb(255, 70, 130, 180));
                        //objSeriesMapping3.ItemMappings.Add(new ItemMapping("FiscalMonth", DataPointMember.XCategory));
                        objSeriesMapping3.ItemMappings.Add(new ItemMapping("VTBQTD", DataPointMember.YValue));

                        objSeriesMapping3.SeriesDefinition.ItemLabelFormat = "P0";



                        SeriesMapping objSeriesMapping4 = new SeriesMapping();

                        objSeriesMapping4.SeriesDefinition = BarDefYOYQTD;
                        BarDefYOYQTD.LabelSettings.LabelDisplayMode = LabelDisplayMode.Inside;

                        objSeriesMapping4.LegendLabel = "YOY %";
                        objSeriesMapping4.SeriesDefinition = BarDefYOYQTD;
                        objSeriesMapping4.SeriesDefinition.Appearance.Fill = new SolidColorBrush(Colors.Brown);
                        //objSeriesMapping4.ItemMappings.Add(new ItemMapping("FiscalMonth", DataPointMember.XCategory));
                        objSeriesMapping4.ItemMappings.Add(new ItemMapping("YOYQTD", DataPointMember.YValue));

    Can you please assist me how can i remove "1" in X-Axis?
  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 19 Sep 2012 Link to this post

    Hello Madhan,

    In order to hide the X Axis labels you have to set the radChart.DefaultView.ChartArea.AxisX.AxisLabelsVisibility to System.Windows.Visibility.Collapsed. And if you want to hide the whole axis (including the ticks) try:
    radChart.DefaultView.ChartArea.AxisX.Visibility = System.Windows.Visibility.Collapsed;
    I hope this helps. For more information check our documentation.

    Petar Kirov
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. Keith
    Keith avatar
    19 posts
    Member since:
    Aug 2012

    Posted 06 Aug 2013 Link to this post

    is there a way to hide the x-axis line but still show the x-axis labels?

    For instance, we have situations where we have to do custom code to reverse the Y-axis to make certain information make sense. Our x-axis is at the top instead of the bottom (yaxis of 0 in the screen shot attached) so we get an odd occurrences where it throws off the set steps (y-axis steps are set to 5 but the intervals are in 4) and the x-axis is drawn on top of the series (shown in screen shot).

    I've already tried your suggestion but it hides the ticks/labels which we need to be showing (as you said it would). Is there some way to hide that axis line while still keeping its information?

    EDIT: in the screenshot attached both major/minorGridLines for the Yaxis are currently off. The only line being shown is the X-Axis.
  4. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 09 Aug 2013 Link to this post

    Hello Keith,

    You can try this code:
    this.radChart1.DefaultView.ChartArea.AxisY.PlotAreaAxisVisibility = System.Windows.Visibility.Collapsed;

    Petar Marchev
    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