Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在线型打印上显示文字?_C#_Oxyplot - Fatal编程技术网

C# 如何在线型打印上显示文字?

C# 如何在线型打印上显示文字?,c#,oxyplot,C#,Oxyplot,我试图将点的值打印到绘图上,但提供的文档不完整或令人困惑。我知道TrackPerformatString值可以做类似的事情,但我希望文本始终位于随不同值动态变化的绘图上。有什么我可能忽略了或者我可以研究的吗 var series1 = new LineSeries { Title = "Stage I", MarkerType = MarkerType.Circle, Smooth = true, TrackerFormatString = "Stage I\nYear: {2:0.0}\n{4

我试图将点的值打印到绘图上,但提供的文档不完整或令人困惑。我知道TrackPerformatString值可以做类似的事情,但我希望文本始终位于随不同值动态变化的绘图上。有什么我可能忽略了或者我可以研究的吗

var series1 = new LineSeries { Title = "Stage I", MarkerType = MarkerType.Circle, Smooth = true, TrackerFormatString = "Stage I\nYear: {2:0.0}\n{4:0.0} %" };
//let's say I have a line series like this
//I need to enter some sort of text on the plot that has the values of the below points:
        series1.Points.Add(new DataPoint(0.0, 100.0));
        series1.Points.Add(new DataPoint(1, 82.3));
        series1.Points.Add(new DataPoint(3, 59.2)); 
        series1.Points.Add(new DataPoint(5, 47.7));


对此,任何形式的帮助都将不胜感激

您可以向绘图中添加注释。要显示文本,请使用
TextAnnotation

将注释添加到模型中,为位置提供
数据点
,为要显示的文本提供
文本
。比如说

yourModel.Annotations.Add(new TextAnnotation { TextPosition = new DataPoint(DateTimeAxis.ToDouble(now), wert), Text = "82.3%" });

那么,您想添加注释吗?