2017-06-07 5 views
2

私は、プロット上にポイントの値を印刷しようとしているが、提供される文書が不完全であるか、紛らわしいです。私は、TrackerFormatStringの値が似たようなことをすることができることを理解していますが、テキストを常に異なる値で動的に変化するプロットにしたいと思います。私はおそらく見落とした、または私が調べることができるものはありますか?LineSeriesプロット上にテキストを表示するにはどうすればよいですか?

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)); 

This is what I have:

This is what I need:

これでヘルプの任意の並べ替えをいただければ幸いです!

+0

注釈を追加したいですか? –

答えて

0

あなたのプロットに注釈を追加することができます。テキストを表示するには、TextAnnotationを使用します。

モデルに注釈を追加します。場所にはDataPoint、テキストにはTextが表示されます。たとえば、

yourModel.Annotations.Add(new TextAnnotation { TextPosition = new DataPoint(DateTimeAxis.ToDouble(now), wert), Text = "82.3%" }); 
関連する問題