You refer to the pane with this line:
GraphPane pane = mPane[0];
The subsequent graphical operations are then performed on this pane object.
To draw a line curve, you should use the PointPairList collection that the ZedGraph
library provides. This allows you to create a single collection of data items that correspond
to the X and Y values of a chart. The PointPairList supports many data types,
including dates, so it??™s perfect for the example??™s needs.
After the input parameters (ticker and days) have been read in and sanitized, the
DataTier service is called to return a DataTable containing the results of the query for that
stock and the number of days of price history you want for it.
You then iterate through the DataTable and pull this information out like this:
for (int i = 1; i < nRows; i++)
{
ny = Convert.ToDouble(dtTable.Rows[i].ItemArray[1]);
XDate tmpDate = new XDate(
Convert.ToDateTime(dtTable.Rows[i].ItemArray[0]));
nx = (double)tmpDate;
pt.Add(nx, ny);
}
CHAPTER 10 ?– BUILDING A SAMPLE APPLICATION USING ASP.NET AJAX 246
The closing price for the stock should go on the y axis, so it comes from .
Pages:
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343