3

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?

JYelton
  • 35,664
  • 27
  • 132
  • 191
Guy
  • 31
  • 3

1 Answers1

2

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 values double.NaN.
Zedgraph treats NaN as an empty element and does not draw the curve for it. If you would add NaN somewhere inside, you would have two curves separated by some gap. It is quite useful to use NaNs as placeholders in ZG.

Gacek
  • 10,184
  • 9
  • 54
  • 87
  • Thanks for the response and information. I will try to explain the problem form another angle: 20 Candle stick in the first graph for 20 dates from 1/1/2000 to 21/1/2000 The second graph is a simple linear graph that has 4 point: 4/1/2000, 8/1/2000, 12/1/2000 and 16/1/2000 and the should all be connected (one line should be drawn to connect them all) The Y values for those two graphs are in the same range of prices. I assume the answer you provided with the NAN wont do the work as the line will not be continuous. Any ideas? – Guy Jul 06 '11 at 06:01
  • 1
    Well, I haven't used ZG for quite a long time, but AFAIR you cannod do that with ordinary curves. You need to use `LineItem`s instead. – Gacek Jul 06 '11 at 21:18