SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 329 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"

These are used to make a
call to the DataTier web service to get the DataTable back. The DataTable then loads the
graph with the appropriate data.
CHAPTER 10 ?–  BUILDING A SAMPLE APPLICATION USING ASP.NET AJAX 244
The following code segment shows the full code for the ZedGraphWeb1_RenderGraph
event handler:
protected void ZedGraphWeb1_RenderGraph(
System.Drawing.Graphics g, ZedGraph.MasterPane mPane)
{
int nDays = 0;
int nRows = 0;
GraphPane pane = mPane[0];
PointPairList pt = new PointPairList();
double nx;
double ny;
string days = (string)Page.Request.Params["days"];
string ticker = (string)Page.Request.Params["ticker"];
if (ticker != null)
{
ticker = ticker.Trim();
DataTier theDataTier = new DataTier();
if (days == null)
nDays = 0;
else
nDays = Convert.ToInt32(days);
DataTable dtTable =
theDataTier.GetFullPriceHistory(ticker,nDays);
nRows = dtTable.Rows.Count;
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.


Pages:
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341