カスタムを作成するのは簡単です:
public class CustomTextAnnotation : Annotation
{
public CustomTextAnnotation()
{ }
public string Text { get; set; }
public double X { get; set; }
public double Y { get; set; }
public override void Render(IRenderContext rc)
{
base.Render(rc);
double pX = PlotModel.PlotArea.Left + X;
double pY = PlotModel.PlotArea.Top + Y;
rc.DrawMultilineText(new ScreenPoint(pX, pY), Text, TextColor, Font, FontSize, FontWeight);
}
}
また、あなたが他を追加できることに注意してください。:
plotModel.Annotations.Add(new CustomTextAnnotation() {
Text = "A B C",
X = 110,
Y = 10,
Font = "Times New Roman",
FontSize = 12,
TextColor = OxyColors.Black });
など、あなたはフォント、のFontSizeを設定する必要があることに注意してください境界線の色や他のものなどのプロパティも、しかし、物事は複雑になるかもしれない(私は試していない)。
希望します。
出典
2017-03-05 09:19:11
Ron