ItemArray[1]
and is converted to a Double value. The original source from Yahoo! and the column on
the DataTable encode the value as a string. This is retrieved and loaded into the ny
variable.
The date for the closing price should go onto the x axis. This uses the XDate class (also
part of the ZedGraph library), which is the data type used by ZedGraph to store dates in
a chart and automatically generate axes from them. When using a PointPairList, you
encode the XDate into a Double. You can see this being encoded in the variable nx.
Finally, you add the values for nx and ny to the PointPairList (called pt).
To finalize drawing the chart, you load the PointPairList, set the visual configuration
of the chart, and call the AxisChange method, which refreshes it. First set the XAxis to be
date encoded so that it recognizes the Doubles as dates:
pane.XAxis.Type = AxisType.Date;
Then load the PointPairList onto the chart. You do this using the AddCurve method
of the pane. This method takes four parameters. The first is a string with the name of the
data range. In this case, it is Closing Price.
Pages:
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344