将 2 个图表添加到 Zedgraph 中的同一窗格
我正在使用窗格来绘制蜡烛棒(Add JapaneseCandleStick):
XAxis = AxisType.DateAsOrdinal;
到目前为止一切都很完美。
问题:
我想向同一窗格添加另一条曲线(简单线性图) X 轴也是日期,Y 轴的值与烛台的范围相同 线性图的点数比蜡烛图少,导致线性图无法正确绘制并出现在窗格的开头,而不是根据点日期
(我没有足够的积分来上传图像。 ) 有什么想法可以克服这个问题吗?
I am using pane to draw Candle sticks (AddJapaneseCandleStick):
XAxis = AxisType.DateAsOrdinal;
Everything till this point works perfect.
Problem:
I would like to add another curve (simple linear graph) to the same pane
Xaxis are dates as well and the values of YAxis are in the same ranges as the candle sticks
The linear graph has less points than the candle stick graph, causing the linear graph not to draw correctly and appear in the beginning of the pane and not according to the points dates
(I do not have enough credits to upload the image.) Any ideas how can I overcome this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道我是否正确理解你的问题。例如,我假设您有 20 个日期的 20 个烛台,但您只想为其中最后 10 个绘制折线图?
如果是,请使用
NaN
作为占位符。因此,在上面的示例中,您必须在包含值double.NaN
的线图数据的开头添加 10 个点。Zedgraph 将
NaN
视为空元素,并且不为其绘制曲线。如果您在内部某处添加NaN
,您将得到两条由一些间隙分隔的曲线。在 ZG 中使用 NaN 作为占位符非常有用。I don't know if I understand your problem correctly. I assume you have for example 20 candlesticks for 20 dates, but you want to draw a line graph for only last 10 of them?
If yes, use
NaN
as a placeholder. So in the example above, you would have to add 10 points at the beginning of your line plot data containing valuesdouble.NaN
.Zedgraph treats
NaN
as an empty element and does not draw the curve for it. If you would addNaN
somewhere inside, you would have two curves separated by some gap. It is quite useful to useNaN
s as placeholders in ZG.