Chart: hide minor tick marks on x axis

Feb 10, 2015 at 7:06 PM
Edited Feb 10, 2015 at 7:25 PM

I'm using the Chart to build a graph at runtime based on user input. This amounts to me creating one to many LineSeries and adding them to (or removing them from) the chart's Series collection.

This much is working great.

I've got requirements to only show x-axis values in whole-number increments. By default, the chart's interval is 0.1. How do I configure this? I've tried adding an Axis to my LineSeries as such:
var series = new LineSeries
    Title = state.Meta.Title,

    IndependentValuePath = "X",
    DependentValuePath = "Y",

    DataPointStyle = x.Skipped ? state.Meta.SkippedPointStyle : state.Meta.PointStyle,
    PolylineStyle = x.Skipped ? state.Meta.SkippedLineStyle : state.Meta.LineStyle,

    IndependentAxis = new LinearAxis
        Interval = 1,
        Orientation = AxisOrientation.X

    ItemsSource = x.Data
but this results is my chart having more than two ActualAxis. I end up with one Y and many Xs. Unfortunately, ActualAxis is not observable so I cannot configure the axis Interval or MinorTickStyle when the graph generates them. Is there any way to get in the middle of ActualAxis creation and change properties on that axis? I can't find any kind of event to hook into that occurs when this happens.

Any help here would be greatly appreciated! Thanks