Zed Graph Web and datatable

1.6k Views Asked by At

How can i use zed graph web to graph a dataset or datatable, the only examples i have found use test data.

example

2

There are 2 best solutions below

0
On BEST ANSWER

Here is a fairly straight forward tutorial. As of yesterday, I had no experience with ZedGraph, and this tutorial helped me learn inside out, and only took about 15 minutes.

http://www.codeproject.com/KB/graphics/zedgraph.aspx

He adds points to 2 lists:

  list1.Add( x, y1 );
  list2.Add( x, y2 );

This is because he is using two lines, do not confuse the two for a set of points, each list is its own set of points (hence the two different lines in the graph). If you want to graph database output, simply load in the points as you read in your records. Ex/

 while (aReader.Read())
    {
         list1.Add(aReader.GetString(0), aReader.GetString(1);
    }

Good luck!

EDIT: I just noticed this was VB.NET. You will have to download the VB code example from that tutorial if you would like to see the demonstration. They only show the c# I believe.

0
On

Loop through the rows in your DataTables and use that data to plot your points.