首页 > 解决方案 > 在 OxyPlot 中设置 X 轴的 Y 位置

问题描述

我正在用优秀的 OxyPlot 库绘制一个基本的 LineSeries:

在此处输入图像描述 我找不到如何将 X 轴设置为以 0 Y 值为中心,而不是在 PlotArea 的底部。

我的代码隐藏如下:

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

标签: wpfoxyplot

解决方案


我正在寻找班级的PositionAtZeroCrossing财产。Axis

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

在此处输入图像描述


推荐阅读