gpt4 book ai didi

c# - 如何在新的 Microsoft 图表控件中为数据点添加垂直线

转载 作者:太空宇宙 更新时间:2023-11-03 14:35:40 25 4
gpt4 key购买 nike

所以我正在使用这个新奇的图表控件。 More info here

我已经显示了数据。我想要做的是添加一个每年都有的行分隔符。基本上是每年一月一号竖红线?

有什么想法吗???一年中的每一天都不存在数据点。它可以是 365 到两年分隔符之间的 1 个数据点。

我尝试查看示例但没有得到任何有用的想法。有人吗?

于是我发现他们有StripLine

Stripline stripLine = new StripLine();

我想知道如何将它添加到一个点中。不要让它自动重复。有人吗?

需要说明的是,我有一个图表,在我找到符合特定条件的点后立即添加点时,我也想在该位置添加带状线。

最佳答案

这可能对每年的 1 月 1 日有帮助:

StripLine stripLine = new StripLine();
stripLine.BackColor = Color.Red;
stripLine.IntervalOffset = 1; //how many days until Jan 1 from the start of the range? This is always relative to the data being displayed.
stripLine.IntervalOffsetType = DateTimeIntervalType.Days; //days in reference to the above question

stripLine.Interval = 60; //set a marker every 60 days
stripLine.IntervalType = DateTimeIntervalType.Days; //in relation to comment above

stripLine.StripWidth = 1; //show the marker in a 1 day width
stripLine.StripWidthType = DateTimeIntervalType.Days; //in relation to comment above
Chart1.ChartAreas["ChartArea1"].AxisX.StripLines.Add(stripLine);

关于c# - 如何在新的 Microsoft 图表控件中为数据点添加垂直线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1196049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com