3

I am using WPF DataVisualization chart control to show some sample data. My problem is Y axis is showing decimal values. How can I make it show only integer values.

This is my XAML code for the

<chartingToolkit:Chart Margin="0,30,0,30" Name="columnChart" Title="" Foreground="Black"  >
    <chartingToolkit:ColumnSeries DependentValuePath="Value" Background="Red"  
    IndependentValuePath="Key" ItemsSource="{Binding}"  >
        <chartingToolkit:ColumnSeries.DataPointStyle>
            <Style TargetType="Control">
                <Setter Property="Background" Value="#A80729"/>
            </Style>
        </chartingToolkit:ColumnSeries.DataPointStyle>
    </chartingToolkit:ColumnSeries>
</chartingToolkit:Chart>

snapshot of the chat here

Jeffrey Blake
  • 9,659
  • 6
  • 43
  • 65
Kakopappa
  • 207
  • 2
  • 8

1 Answers1

4

set interval and Minimum,

some thing like,

    <chartingToolkit:ColumnSeries.DependentRangeAxis>
                <chartingToolkit:LinearAxis FontSize="15" Foreground="White" Interval="1" Minimum="0" Orientation="Y" ShowGridLines="False" />
            </chartingToolkit:ColumnSeries.DependentRangeAxis>
            <chartingToolkit:ColumnSeries.IndependentAxis>
                <chartingToolkit:CategoryAxis FontSize="12" Foreground="Gray" Orientation="X" ShowGridLines="False" />
            </chartingToolkit:ColumnSeries.IndependentAxis>

hope this helps!

Jilji
  • 244
  • 1
  • 2
  • 8