【问题标题】:Can I draw vertical lines on the LineSeries Graph?我可以在 LineSeries 图表上画垂直线吗?
【发布时间】:2019-04-08 16:52:01
【问题描述】:

我正在使用一些 OxyPlot 图表制作应用程序。

我想制作一个在 LineSeries 图表上有一条垂直线的图表,如下链接:

http://theclosetentrepreneur.com/how-to-add-a-vertical-line-to-an-excel-xy-chart

(我的理想图片在“格式化图表的技巧……”中。)

如何制作这个图表?

【问题讨论】:

    标签: c# wpf oxyplot


    【解决方案1】:

    您可以为此目的使用 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);
    

    样本输出

    【讨论】:

    • 感谢您的评论!这是我理想的图表!你的答案很完美,真的谢谢你! XD
    • @siksmtt 很高兴为您提供帮助。干杯
    猜你喜欢
    • 2023-02-04
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 2021-03-07
    • 2022-11-27
    • 1970-01-01
    • 2017-01-06
    相关资源
    最近更新 更多