|
-
May 30th, 2013, 12:45 PM
#1
Thread Starter
New Member
[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
-
May 30th, 2013, 12:51 PM
#2
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?
-
May 30th, 2013, 01:02 PM
#3
Thread Starter
New Member
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?
-
May 30th, 2013, 01:12 PM
#4
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.
-
May 31st, 2013, 12:31 PM
#5
Thread Starter
New Member
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
-
May 31st, 2013, 12:56 PM
#6
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.
-
May 31st, 2013, 01:07 PM
#7
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|