繁体   English   中英

OxyPlot - 如何删除轴

[英]OxyPlot - How to remove Axes

我想创建一个没有任何轴可见的Oxyplot视图。

谁能告诉我怎么做?

为了避免误解,我从未在剧情模型中添加任何轴。

此代码已添加轴。 如何避免它们出现?

C#

        plot = new PlotModel();
        var ser = new LineSeries();
        ser.Points.Add(new DataPoint(1, 1));
        plot.Series.Add(ser);

XAML

<oxy:PlotView Background="Transparent" Model="{Binding plot}"</oxy:PlotView>

在此输入图像描述

oxyplot axes文档中所述

如果未定义轴,则将在底部和左侧添加线性轴。

所以,正如@JohnStrit所说,你必须在你的情节模型中添加“隐形”轴,就像那样:

plot.Axes.Add(new LinearAxis()
{
    Position = AxisPosition.Bottom,
    IsAxisVisible = false
});

plot.Axes.Add(new LinearAxis()
{
    Position = AxisPosition.Left,
    IsAxisVisible = false
});

我已经检查过这种方式并且有效。

使用IsAxisVisible属性。

在XAML中:

<oxy:LinearAxis IsAxisVisible="False"/>

在C#中:

plot.Axes[0].IsAxisVisible = false;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM