我试图将文本信息放在系列中特定点的上方,并将它们链接起来,这意味着如果我滚动绘图,文本始终相对于系列中的特定点位于相同的位置。像这样:
我可以说我的 int[] 数据的长度是 15,它包含值 {22, 44, 55, 87, 33, 21, 23, 44, 33, 42, 54, 56, 66, 77, 99}
我需要在位置 3 上放置字母“H”,在位置 8 上放置“Z”,在位置 12 上放置“T”。所有注释都靠近绘图区域的顶部。我的代码可以正常显示常规 LineSeries,但我不知道如何添加注释。
public void SetWaveformData(int[] data)
{
PlotModel plotModel = new PlotModel();
List<DataPoint> dataSeries = new List<DataPoint>();
int i = 0;
foreach (int yValue in data)
{
dataSeries.Add(new DataPoint { X = i++, Y = yValue });
}
LineSeries ser = new LineSeries();
ser.Points.AddRange(dataSeries);
plotModel.Series.Add(ser);
}