我想创建一个没有任何可见轴的 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 轴文档 http://docs.oxyplot.org/en/latest/models/axes/:
如果没有定义轴,线性轴将添加到底部并
左边。
因此,正如 @JohnStrit 所说,您必须将“隐形”轴添加到绘图模型中,如下所示:
plot.Axes.Add(new LinearAxis()
{
Position = AxisPosition.Bottom,
IsAxisVisible = false
});
plot.Axes.Add(new LinearAxis()
{
Position = AxisPosition.Left,
IsAxisVisible = false
});
我已经检查过这种方法并且有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)