Search code examples
c#oxyplot

How to prevent axis from auto-scaling?


Each time I add new data to series, Y axis is panning/zooming automatically in order to fit new data into screen. How can I prevent Oxyplot from touching the axis? I would like to have the scale fixed all the time, no matter what data I feed to plot


Solution

  • As @Taw stated, the properties in oxyplot are the same:

    plotModel.Axes.Add(new LinearAxis()
    {
        Position = AxisPosition.Left,
        Minimum = 0,
        Maximum = 10,
    });
    
    plotModel.Axes.Add(new LinearAxis()
    {
        Position = AxisPosition.Bottom,
        Minimum = 0,
        Maximum = 10,
    });