此代码在示例中
var lineAnnotation4 = new LineAnnotation();
lineAnnotation4.Type = LineAnnotationType.Horizontal;
lineAnnotation4.Y = 2;
lineAnnotation4.Color = OxyColors.Gold;
lineAnnotation4.MaximumX = 4;
lineAnnotation4.Text = "Horizontal";
plotModel1.Annotations.Add(lineAnnotation4);
感谢。
答案 0 :(得分:1)
尝试 lineAnnotation4.TextVerticalAlignment = VerticalAlignment.Top
修改强>
看起来相当直观,但实际上您需要指定lineAnnotation4.TextVerticalAlignment = VerticalAlignment.Bottom;