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

How to hide X-Axis Scale?

3 Answers 204 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Madhan
Top achievements
Rank 1
Madhan asked on 14 Sep 2012, 09:00 AM
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";

                    objChartArrayQTD.BarChart.SeriesMappings.Add(objSeriesMapping3);

                

                    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?

3 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 19 Sep 2012, 07:25 AM
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.

Greetings,
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.

0
Keith
Top achievements
Rank 1
answered on 06 Aug 2013, 03:47 PM
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.
0
Petar Marchev
Telerik team
answered on 09 Aug 2013, 07:58 AM
Hello Keith,

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

Regards,
Petar Marchev
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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
Madhan
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Keith
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or