箭头绘制快速开始
箭头可以放置在绘图上以指向坐标空间中的某个位置,并进行广泛自定义。
// create a line
Coordinates arrowTip = new(0, 0);
Coordinates arrowBase = new(1, 1);
CoordinateLine arrowLine = new(arrowBase, arrowTip);
// add a simple arrow
WpfPlot1.Plot.Add.Arrow(arrowLine);
// arrow line and fill styles can be customized
var arrow2 = WpfPlot1.Plot.Add.Arrow(arrowLine.WithDelta(1, 0));
arrow2.ArrowLineColor = Colors.Red;
arrow2.ArrowMinimumLength = 100;
arrow2.ArrowLineColor = Colors.Black;
arrow2.ArrowFillColor = Colors.Transparent;
// the shape of the arrowhead can be adjusted
var skinny = WpfPlot1.Plot.Add.Arrow(arrowLine.WithDelta(2, 0));
skinny.ArrowFillColor = Colors.Green;
skinny.ArrowLineWidth = 0;
skinny.ArrowWidth = 3;
skinny.ArrowheadLength = 20;
skinny.ArrowheadAxisLength = 20;
skinny.ArrowheadWidth = 7;
var fat = WpfPlot1.Plot.Add.Arrow(arrowLine.WithDelta(3, 0));
fat.ArrowFillColor = Colors.Blue;
fat.ArrowLineWidth = 0;
fat.ArrowWidth = 18;
fat.ArrowheadLength = 20;
fat.ArrowheadAxisLength = 20;
fat.ArrowheadWidth = 30;
// offset backs the arrow away from the tip coordinate
WpfPlot1.Plot.Add.Marker(arrowLine.WithDelta(4, 0).End);
var arrow4 = WpfPlot1.Plot.Add.Arrow(arrowLine.WithDelta(4, 0));
arrow4.ArrowOffset = 15;
WpfPlot1.Plot.Axes.SetLimits(-1, 6, -1, 2);
WpfPlot1.Refresh();