【发布时间】:2019-12-09 13:07:05
【问题描述】:
我将 Oxyplot 与 WPF 和 C# 一起使用
我是 Oxyplot 的新手,想了解如何使用 Lineannotations。
我想在我的绘图模型中添加 2 个 Lineannotations,一个应该是垂直的,另一个应该是水平的。
我的问题是只显示水平 LineAnnotation (annotation2) 而垂直不显示。
代码如下:
var annotation = new LineAnnotation();
annotation.Color = OxyColors.Blue;
annotation.LineStyle = LineStyle.Solid;
annotation.StrokeThickness = 5;
annotation.X = 0;
annotation.Type = LineAnnotationType.Vertical;
Model.Annotations.Add(annotation);
//this works
var annotation2 = new LineAnnotation();
annotation2.Color = OxyColors.Blue;
annotation2.LineStyle = LineStyle.Solid;
annotation2.StrokeThickness = 5;
annotation2.Y = 0;
annotation2.Type = LineAnnotationType.Horizontal;
Model.Annotations.Add(annotation2);
Model.InvalidatePlot(true);
垂直注释不显示的原因是什么?
【问题讨论】: