Sample Graphs

From ZedGraphWiki

Jump to: navigation, search

ZedGraphControl Reference Code Sample

Go to the following pages for page for detailed instructions on using the sample chart code in your language preference:

Special Note: We are currently in the process of updating the wiki to reflect samples designed for version 5.0 of ZedGraph (released June 24th). However, in the meantime there will be some version 4.3 samples and some version 5.0 samples. Ultimately, we hope to maintain both for awhile so ZedGraph remains accessible to those that are limited to .Net 1.1.

Sample Charts

This section contains example charts generated with ZedGraph. Each chart includes sample source code required to create the graph. If you click on the chart image, you'll just see a larger version of the image. Click on the text to the right of the image (for example, "Line & Symbol Charts") to actually see the page of interest.


filled_curve_150.gif Line & Symbol Charts

vertical_bars_labels_150.gif Bar Charts

pie_demo_150.gif Pie Charts

combo_150.gif Special Charts

modified_initial_150.gif Charts from CodeProject Tutorial


Using the samples without the ZedGraphControl (Class Library Only)

These samples are setup to work specifically with the ZedGraphControl. However, they can be easily adapted to work with the class library if you make a few simple changes. First, instead of passing the ZedGraphControl, just pass the GraphPane (or MasterPane, as appropriate). The top of the CreateGraph() method should look like this:

public void CreateGraph( GraphPane myPane )

or for Visual Basic:

Private Sub CreateGraph(ByVal myPane As GraphPane)

At the end of the CreateGraph() method, there is a call to AxisChange() using the ZedGraphControl. Change that call to this:

Graphics g = CreateGraphics();
myPane.AxisChange( g );
g.Dispose();

or for Visual Basic:

Dim g as Graphics = CreateGraphics()
myPane.AxisChange( g )
g.Dispose()

Back to Main Page

Personal tools