在OxyPlot中设置X轴的Y位置

问题描述

我正在使用出色的OxyPlot库绘制基本的Lineseries:

enter image description here

我找不到如何将X轴设置为以0 Y值为中心而不是PlotArea底部的中心。

我的后台代码如下:

Model = new PlotModel();
Lineseries RightingLever = new Lineseries();
RightingLever.Title = "Righting Lever";
// adding points
Model.Series.Add(RightingLever);
PlotView.Model = Model;

解决方法

我正在寻找PositionAtZeroCrossing类的Axis属性。

foreach (var axis in Model.Axes)
{
    axis.PositionAtZeroCrossing = true;
    axis.AxislineStyle = LineStyle.Automatic;
}

enter image description here