LinearAxis has the Iterval property. Try to install
<Charting:Chart.Axes> <Charting:LinearAxis Interval="1" Orientation="Y" Minimum="0" Title="" Location="Left" /> </Charting:Chart.Axes>
According to your comment (sorry, I thought the problem was easier;)), I used a similar approach to render the label along the Y axis:
in resources, use a style similar to this
<Style x:Key="ChartLabelNoDecimal" TargetType="chartingToolkit:AxisLabel"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="chartingToolkit:AxisLabel"> <TextBlock DataContext="{TemplateBinding FormattedContent}" Text="{Binding Converter={StaticResource NumericConverter1}}" FontSize="9" /> </ControlTemplate> </Setter.Value> </Setter> </Style> public class NumericConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { double x = double.Parse(value.ToString()); if() return string.Empty; else return x; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }
then you can add LinearAxis with this style to your chart. My NumericConverter just check the label value that the chart wants to display and format accordingly, with my logic. You can check if the value is an integer, so return the correct string or empty otherwise. I think it can work.
source share