Add(nx, ny);
}
pane.XAxis.Type = AxisType.Date;
pane.XAxis.GridDashOff = 0;
LineItem priceCurve = pane.AddCurve(
"Closing Price", pt, Color.SlateBlue,
CHAPTER 10 ?– BUILDING A SAMPLE APPLICATION USING ASP.NET AJAX 245
SymbolType.None);
priceCurve.Line.Width = 2.0F;
pane.AxisFill = new Fill(Color.White, Color.AntiqueWhite);
pane.XAxis.MinGrace = 0;
pane.XAxis.MaxGrace = 0;
pane.YAxis.MinGrace = 0;
pane.YAxis.MaxGrace = 0;
pane.AxisChange(g);
}
}
This event handler takes two parameters. The first is the base System.Drawing.
Graphics object. To render the graph, right at the bottom of the event handler, the
System.Drawing.Graphics object is passed to the AxisChange method of a ZedGraph pane
to refresh and redraw the graph. The second parameter is a reference to the ZedGraph
master pane, which is the collection of drawing surfaces that the ZedGraph exposes.
Check out the ZedGraph documentation for information about how to use the panes to
create different drawing surfaces. This graph is a simple line chart that uses only one
pane, which is the one at the zero index of this collection.
Pages:
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342