我正在使用一些OxyPlot Graphs制作应用程序。
我想在LineSeries图上创建一个垂直线的图形,如下链接:
http://theclosetentrepreneur.com/how-to-add-a-vertical-line-to-an-excel-xy-chart
(我的理想形象出现在“关于格式化图表的提示......”中。)
我该如何制作这张图?
您可以将LineAnnotation用于此目的。例如,
var annotation = new LineAnnotation();
annotation.Color = OxyColors.Blue;
annotation.MinimumY = 10;
annotation.MaximumY = 40;
annotation.X = 5;
annotation.LineStyle = LineStyle.Solid;
annotation.Type = LineAnnotationType.Vertical;
MyPlotModel.Annotations.Add(annotation);
样本输出