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

[Solved] Hide Axis Labels

1 Answer 686 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andy Macourek
Top achievements
Rank 1
Andy Macourek asked on 15 Mar 2013, 07:42 PM
How do I have the just the lines of the x and y chart axis and hide the label?

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 18 Mar 2013, 12:52 PM
Hello Andy,

You can achieve the desired functionality by setting Axis.ShowLabels property to false and by setting custom Axis.MajorTickStyle to collapse the tick marks:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <Grid.Resources>
        <Style x:Key="TickStyle" TargetType="Rectangle">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
    </Grid.Resources>
         
    <telerik:RadCartesianChart>
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:CategoricalAxis ShowLabels="False" MajorTickStyle="{StaticResource TickStyle}" />
        </telerik:RadCartesianChart.HorizontalAxis>
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LinearAxis ShowLabels="False" MajorTickStyle="{StaticResource TickStyle}" />
        </telerik:RadCartesianChart.VerticalAxis>
        <telerik:LineSeries>
            <telerik:LineSeries.DataPoints>
                <charting:CategoricalDataPoint Category="a" Value="1" />
                <charting:CategoricalDataPoint Category="b" Value="2" />
                <charting:CategoricalDataPoint Category="c" Value="1" />
                <charting:CategoricalDataPoint Category="d" Value="4" />
                <charting:CategoricalDataPoint Category="e" Value="1" />
            </telerik:LineSeries.DataPoints>
        </telerik:LineSeries>
    </telerik:RadCartesianChart>
</Grid>

Hope this helps.


All the best,
Giuseppe
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Andy Macourek
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or