Strange behavior on zooming/moving

Apr 29, 2014 at 2:25 PM
Hi,

When I right click on chart or scroll with wheel, charts automatically zooms to strange position, (0,0) + data.

Package version 2014.1.296.1

xaml code
<Window x:Class="OxyPlotTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:oxy="http://oxyplot.codeplex.com"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <oxy:Plot>
            <oxy:LineSeries x:Name="Test" Title="Test" ItemsSource="{Binding}" />
        </oxy:Plot>
    </Grid>
</Window>
code behind
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OxyPlotTest
{

    public class Model
    {
        public double X { get; set; }
        public double Y { get; set; }


    }

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        protected ObservableCollection<Model> TestData;

        public MainWindow()
        {
            TestData = new ObservableCollection<Model>();
            TestData.Add(new Model() { X = 150000, Y = 10000 });
            TestData.Add(new Model() { X = 150002, Y = 10000 });
            TestData.Add(new Model() { X = 150004, Y = 10000 });
            TestData.Add(new Model() { X = 150006, Y = 10000 });
            TestData.Add(new Model() { X = 150008, Y = 10000 });
            TestData.Add(new Model() { X = 150010, Y = 10000 });
            TestData.Add(new Model() { X = 150012, Y = 10000 });
            TestData.Add(new Model() { X = 150014, Y = 10000 });

            InitializeComponent();
            Test.DataContext = TestData;
            Test.Mapping = (x) => { var m = x as Model; return new OxyPlot.DataPoint(m.X, m.Y); };
        }
    }
}
Any advice how to change this behavior to keeping its display context?

Thanks.
May 6, 2014 at 7:49 PM
Solved by manually adding axes to plot.
Marked as answer by pvyhlas on 5/6/2014 at 12:49 PM