Completely hide X and Y Axis

5 posts, 0 answers
  1. Daniel Woodard
    Daniel Woodard avatar
    13 posts
    Member since:
    Aug 2005

    Posted 15 Mar 2011 Link to this post

    Is there a way to completely hide the X and Y axis lines and labels?  I am doing a console with many small line graphs and all I want is the graph lines to show and nothing else.  Is this possible?  I have been going through the documentation, but haven't been able to figure out  how to accomplish this yet.

  2. Daniel Woodard
    Daniel Woodard avatar
    13 posts
    Member since:
    Aug 2005

    Posted 15 Mar 2011 Link to this post

    Never mind, I figured it out.  Just have to set the Visibility to Collapsed on AxisX and AxisY.... duh!
  3. DevCraft banner
  4. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 16 Mar 2011 Link to this post

    Can u show me the code for hiding Y-axis.
    Thanks in advance.
  5. Daniel Woodard
    Daniel Woodard avatar
    13 posts
    Member since:
    Aug 2005

    Posted 16 Mar 2011 Link to this post

    Sure, here is what I ended doing in XAML (below).  

    <telerik:RadChart Height="48" HorizontalAlignment="Left" Margin="325,116,0,0" Name="chartIndexed" VerticalAlignment="Top" Width="208">
        <telerik:RadChart.DefaultSeriesDefinition>
            <telerik:LineSeriesDefinition ShowPointMarks="False" ShowItemLabels="False"/>
        </telerik:RadChart.DefaultSeriesDefinition>
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView>
                <telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartLegend Visibility="Collapsed"/>
                </telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartDefaultView.ChartTitle>
                    <telerik:ChartTitle Visibility="Collapsed"/>
                </telerik:ChartDefaultView.ChartTitle>
                <telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartArea NoDataString="Loading..." >
                        <telerik:ChartArea.AxisX>
                            <telerik:AxisX StripLinesVisibility="Collapsed"
                                           MajorGridLinesVisibility="Collapsed"
                                           MinorGridLinesVisibility="Collapsed"
                                           MajorTicksVisibility="Collapsed"
                                           MinorTicksVisibility="Collapsed"
                                           Visibility="Collapsed"
                                           />
                        </telerik:ChartArea.AxisX>
                        <telerik:ChartArea.AxisY>
                            <telerik:AxisY StripLinesVisibility="Collapsed"
                                           MajorGridLinesVisibility="Collapsed"
                                           MinorGridLinesVisibility="Collapsed"
                                           MajorTicksVisibility="Collapsed"
                                           MinorTicksVisibility="Collapsed"
                                           Visibility="Collapsed"
                                           />
                        </telerik:ChartArea.AxisY>
                    </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
     
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
    </telerik:RadChart>

    You can set the same properties from code:

    myChart.DefaultView.ChartArea.AxisY.Visibility = System.Windows.Visibility.Collapsed;


  6. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 17 Mar 2011 Link to this post

    Thanx A lot for sharing Code. :)
    xD:
Back to Top
DevCraft banner