Ben
Ben

Reputation: 531

How can you set the horizontal axis interval in a WPF Toolkit Chart Control?

I'm using the chart control from the WPF Toolkit. How can I set the interval of the X axis?

I have the following XAML code:

<Grid Height="800">

        <chartingToolkit:Chart  Name="lineChart" Title="Pressure over Time" 
    VerticalAlignment="Top" Margin="20,50,20,0" Height="500">

            <chartingToolkit:Chart.Axes>
                <chartingToolkit:LinearAxis Title="Pressure" Orientation="Y" Interval="100" />
                <chartingToolkit:LinearAxis Title="Time" Orientation="X" Interval="100" />
            </chartingToolkit:Chart.Axes>

            <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding}"  Name="Test"
                                        IsSelectionEnabled="True" ClipToBounds="False">
            </chartingToolkit:LineSeries>


        </chartingToolkit:Chart>

        <Button Width="100" Height="24" Margin="20,556,1058,220" Content="More" Name="Button1" />

    </Grid>

The Y Axis works fine, it shows the interval of 100 but the X axis puts itself on the top (please see the added image) and the interval is the exact amounts of points. Why doesnt it listen to the Interval="100" property in the xaml? And why doesn't it place itself on the bottom?

Chart sample

Upvotes: 2

Views: 5949

Answers (1)

Jelle Capenberghs
Jelle Capenberghs

Reputation: 794

For the location of the linearAxis, you can set the Location property to "Bottom"

in code:

<chartingToolkit:LinearAxis Title="Time" Orientation="X" Interval="100" 
Location="Bottom" />

For the interval problem, i don't know...

Upvotes: 1

Related Questions