Skip to content

Plotting graph based in C#

Bob Cat

Asked Jun 11, 2007, 6:01 AM EDT3 answers
Share
LinkedInX
Greetings Guys,
How can we draw an X-Y plot of the data from the program?

For now, I am accessing a database programmatically such that the methods give me back, a column of values based on an input of 1 term or id. Currently, i am viewing the output in the comand line.
My goal is to view the data output in ASP page as a table and at the same time, plot that data along side a table output.

Any help?

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Try using GDI+

    http://www.codeproject.com/vcpp/gdiplus/GDI_.asp

    Load the values into the coordinate paremeters and draw lines with GDI+ (Convert them to smaller values if you have to, try to use a bit of math and ratio them down so theyll fit neatly on a graph). It wouldnt be hard, just take a little while but the results would probably be what your looking for.

    Good luck!
    Brandon

    P.S. Dont be afraid to google info on GDI+, its plentiful everywhere with lots of tutorials. The site I gave you was just a googled site with a pretty good introduction to it.
    0
  • 0

    Is there an easier way than GDI?

    0
  • 0
    I dont think so... Unless you want to go to DirectX which is pretty advanced stuff. GDI+ isnt too bad to figure out, and it can be used in alot of things. I would at least give it a shot first, see what you can come up with. GDI+ might look tough but its a fairly simple concept.

    All you would be doing is drawing a line to certain coordinates that you specify in the parameters of the paint syntax. Those coordinates would come from your database. You could draw the actual graph itself on the form before runtime to maximize draw speed.

    Good luck!
    Brandon
    0