Results 1 to 7 of 7

Thread: [RESOLVED] Visual Basic Express 2010 Grapging Calulator

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Resolved [RESOLVED] Visual Basic Express 2010 Grapging Calulator

    Hello,

    I am working on a school project that requires me to make a graphing calculator in Visual Basic Express 2010. I have been searching the internet for a few days and have not found the solution to my problem. I have come to the point where i am able to generate the x-y coordinates from any given function. The x values go from -10 to +10. The only thing i need to do now is make the visual graph work. I have not been able to figure out how to create the cartesian plane, and how I will make the graph on the plane.

    Thanks

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Visual Basic Express 2010 Grapging Calulator

    Where's the 420? Do you just make a new name every time you have a question?

    As for your question at hand, do you want to use the Chart control or do you want to actually draw the points on a surface like a panel or picturebox?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic Express 2010 Grapging Calulator

    This is only the second question i have posted on this site, i am not sure what you mean by the 420.

    I have been looking online and i have seen the Chart control option, but i have not been sure how to impliment it. Do you have any suggestions on how to use the chart control to create the x-y plane?

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Visual Basic Express 2010 Grapging Calulator

    Sorry, we had a guy named YoloSwag420 a while back and then he changed his name to SwagYolo420 because of some naughty behavior he did. Any who, if you're going to use the Chart control, how do you plan to populate the chart? Will the data be data-bound from a database or will it be done via user input at runtime?

    Edit -
    Here is an example on how to do it based on user input. All I did was add 1 Chart, 2 NumericUpDown's, and 1 button to the form. The 1 NumericUpDown's will represent the value to be added:
    Code:
    Option Strict On
    Option Explicit On
    Public Class Form1
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            'Add a new point based on x,y coordinates
            'Where x is numericupdown1.value
            'And y is numericupdown2.value
            Chart1.Series.Item(0).Points.AddXY(CInt(NumericUpDown1.Value), CInt(NumericUpDown2.Value))
        End Sub
    
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            'Set the chart a line graph
            Chart1.Series.Item(0).ChartType = DataVisualization.Charting.SeriesChartType.Line
        End Sub
    End Class
    Last edited by dday9; May 30th, 2013 at 01:22 PM.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic Express 2010 Grapging Calulator

    Thanks for that code, it is very helpful. It is exactly what i have been trying to do. Can you give an example of how to plot two points and then join a line between them on this chart? It would be fantastic if youy could.

    Thanks

  6. #6
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Visual Basic Express 2010 Grapging Calulator

    That's exactly what it does, it plots two points. With us setting the chart type to line it creats a line from point a to b.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic Express 2010 Grapging Calulator

    ohhhhh, that was my mistake. I thoght it was creating the grid only. Thanks for all the help.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width