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

Hide ticks on CategoricalAxis?

1 Answer 201 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 12 Dec 2012, 02:11 PM
I'm using CategoricalAxis to create a nice histogram plot. How can I hide the ticks on the horizontal axis?
I read about a MajorTicksVisibility property, but IntelliSense never shows it so I suspect it's not there...

<chart:RadCartesianChart x:Name="RadCartesianChart" Palette="Arctic" Margin="10">
        <chart:RadCartesianChart.DataContext>
            <viewModels:HistogramViewModel />
        </chart:RadCartesianChart.DataContext>
        <chartView:BarSeries ItemsSource="{Binding Data}" ValueBinding="Value"
                            ShowLabels="False" FontFamily="Segoe UI" FontSize="10">
        </chartView:BarSeries>
        <chart:RadCartesianChart.HorizontalAxis>
            <chartView:CategoricalAxis  GapLength="0" ShowLabels="False" FontFamily="Segoe UI" FontSize="12" />
        </chart:RadCartesianChart.HorizontalAxis>

        <chart:RadCartesianChart.VerticalAxis>
            <chartView:LinearAxis FontFamily="Segoe UI" FontSize="12"
                            Title="Histogram"
                            Minimum="0" Maximum="{Binding AxisMaxValue}"
                            ShowLabels="True" />
        </chart:RadCartesianChart.VerticalAxis>
        <chart:RadCartesianChart.Grid>
            <chartView:CartesianChartGrid MajorLinesVisibility="Y" />
        </chart:RadCartesianChart.Grid>
    </chart:RadCartesianChart>

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 14 Dec 2012, 09:10 AM
Hi Kristoffer,

There is no MajorTicksVisibility property in the ChartView suite. Perhaps you have read about the RadChart which does have this property. I think that the easiset way to achieve the desired effect is to simply set an empty style (or null) to the MajorTickStyle of the axis:
<chartView:CategoricalAxis MajorTickStyle="{x:Null}" />

All the best,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or