Graphing data in VB.net - What is the fastest and easiest way?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • petesquawk
    New Member
    • Sep 2009
    • 15

    Graphing data in VB.net - What is the fastest and easiest way?

    What is the fastest and easiest way to graph data in VB.net?

    How do I export 2 columns of data in Vb.net, to either an excel file or to a notepad file?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    How do I export 2 columns of data in Vb.net, to either an excel file or to a notepad file?
    I guess that all depends on what your "columns" really consist of in code.
    Do you have a two dimensional string array? string[10, 20]
    Do you have a dictionary? Dictionary<int, string>

    Loop through whatever variable list/array you have and write the values to a text file. You might want to go to MSDN and read up on the Streamwriter.
    Learn ways to write or append text to a file for a .NET app. Use methods from the StreamWriter or File classes to write text synchronously or asynchronously.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      What is the fastest and easiest way to graph data in VB.net?
      Read up on MSDN regarding the Drawing class.

      Comment

      • petesquawk
        New Member
        • Sep 2009
        • 15

        #4
        The data is in the form of a two dimensional string array.

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          Originally posted by petesquawk
          The data is in the form of a two dimensional string array.
          Then my original suggestion holds up well.
          Originally posted by tlhintoq
          Loop through whatever variable list/array you have and write the values to a text file. You might want to go to MSDN and read up on the Streamwriter.
          http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx
          If you comma-separate or tab-separate the two fields it will import to Excel easily.

          Comment

          • petesquawk
            New Member
            • Sep 2009
            • 15

            #6
            I guess that all depends on what your "columns" really consist of in code.
            Do you have a two dimensional string array? string[10, 20]
            Do you have a dictionary? Dictionary<int, string>

            Loop through whatever variable list/array you have and write the values to a text file. You might want to go to MSDN and read up on the Streamwriter.
            http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx
            I haven't gotten to the graphing portion yet, but the first VB example on http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx works very well. Thank you.

            Comment

            • petesquawk
              New Member
              • Sep 2009
              • 15

              #7
              Read up on MSDN regarding the Drawing class.
              http://msdn.microsoft.com/en-us/library/bb196414.aspx
              I don't know how to implement that code for vb.

              I have been able to get a ZedGraph application working by itself but I haven't been able to get it to work with my code yet. I tried installing MS Chart control but I was unable to get that to work, even after upgrading to SP1 for 3.5.

              I am thinking that I might be able to get ZedGraph to work if I put more time into it.

              Comment

              • tlhintoq
                Recognized Expert Specialist
                • Mar 2008
                • 3532

                #8
                Take a look around the rest of the MSDN. There is LOTS of documentation.
                Take a look at the drawing namespace
                Provides access to GDI+ basic graphics functionality. The System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces provide more advanced functionality. For limitations, see the Remarks section.


                Here's a tip: Google for the terms "MSDN System.Drawing"
                Basically if you Google "MSDN" plus whatever it is you are looking for you will get all the MSDN hits related to what you are working on.
                From there... "Right-Click | Open in new tab" in your browser until you find something useful. I find this great for keeping the Google reply as a table of contents and several MSDN articles open at once

                Comment

                • petesquawk
                  New Member
                  • Sep 2009
                  • 15

                  #9
                  I was able to get Zedgraph to work. I just needed to add under the Solution folder and Zedgraph.dll under the reference section.

                  Comment

                  Working...