How can i draw a diagram like the one in Excel with (X,Y) values ??

Beginner

Well-known member
Joined
Mar 12, 2008
Messages
114
Programming Experience
Beginner
If im to draw something like that ? What approach would i use ?

Ofcourse the 4 columns are hidden and done by internall calculation. I want to select their values and draw them. How may i do that ?

pinkrw6.jpg


bluecr5.jpg
 
You could either use the Graphics class, or a third party component. If you really want it Excel-style, I'd recommend ComponentOne's C1Chart.
 
Can you guide me through this provide me with full details from scratch please ?
 
If im to drawn 4 circles from this code What approch would i use ?


Public Class Form1

VB.NET:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Make your arrays
        Dim BaseX(72) As Double
        Dim BaseY(72) As Double
        Dim PitchX(72) As Double
        Dim PitchY(72) As Double
        Dim RootX(72) As Double
        Dim RootY(72) As Double
        Dim OuterX(72) As Double
        Dim OuterY(72) As Double

        'You're filling in these 4 from your other form.
        Dim Rbg_mm As Double
        Dim Rpg_mm As Double
        Dim Rrg_mm As Double
        Dim Rog_mm As Double

        'These are temporary variables to make the calculations easier.
        Dim dblSinTemp As Double
        Dim dblCosTemp As Double
        For i As Integer = 0 To 360 Step 5
            dblSinTemp = Math.Sin((i * Math.PI) / 180.0)
            dblCosTemp = Math.Cos((i * Math.PI) / 180.0)
            BaseX(i \ 5) = Rbg_mm * dblCosTemp
            BaseY(i \ 5) = Rbg_mm * dblSinTemp
            PitchX(i \ 5) = Rpg_mm * dblCosTemp
            PitchY(i \ 5) = Rpg_mm * dblSinTemp
            RootX(i \ 5) = Rrg_mm * dblCosTemp
            RootY(i \ 5) = Rrg_mm * dblSinTemp
            OuterX(i \ 5) = Rog_mm * dblCosTemp
            OuterY(i \ 5) = Rog_mm * dblSinTemp
        Next

        'That's it.  

    End Sub
End Class
 
Back
Top