6 Replies - 30587 Views - Last Post: 06 March 2008 - 11:55 PM Rate Topic: -----

#1 bimal08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-March 08

How to plot a graph in VB6

Post icon  Posted 06 March 2008 - 11:45 PM

Private Sub DrawlineGraph()
With Draw1
.ClearData
'Graph is a line graph
'Set the origin and axes
    .OriginY = 250
    .OriginX = 50
    .YAxisNegative = 0
    
    .YTop = 50
    .YGrad = 10
    .XTop = 50
    .XGrad = 10
.GraphType = dgtLine
.ShowGrid = True
.YAxisText = "Y Axis"
.XAxisText = "X Axis"
.AxisTextFont.Bold = True

.AddPoint 25, 3, vbRed, "Red Line"
.AddPoint 31, 1, vbRed, ""

.AddPoint 34, 3, vbRed, ""
.AddPoint 37, 9, vbRed, ""

.AddPoint 35, 17, vbRed, ""
.AddPoint 37, 26, vbRed, "Red Line"
.AddPoint 30, 30, vbRed, ""
.AddPoint 0, 0, vbGreen, "Green Line"
.AddPoint 30, 20, vbGreen, ""
.GraphType = dgtLine
.DrawGraph
End With
End Sub

Private Sub Form_Load()
DrawlineGraph
End Sub


This post has been edited by PsychoCoder: 06 March 2008 - 11:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to plot a graph in VB6

#2 bhandari  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 9
  • View blog
  • Posts: 754
  • Joined: 31-January 08

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:49 PM

:code:
Was This Post Helpful? 0
  • +
  • -

#3 bimal08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-March 08

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:50 PM

'simple line curve
Private Sub DrawlineGraph()
With Draw1
.ClearData
'Graph is a line graph
'Set the origin and axes
    .OriginY = 250
    .OriginX = 50
    .YAxisNegative = 0
    
    .YTop = 50
    .YGrad = 10
    .XTop = 50
    .XGrad = 10
.GraphType = dgtLine
.ShowGrid = True
.YAxisText = "Y Axis"
.XAxisText = "X Axis"
.AxisTextFont.Bold = True

.AddPoint 25, 3, vbRed, "Red Line"
.AddPoint 31, 1, vbRed, ""

.AddPoint 34, 3, vbRed, ""
.AddPoint 37, 9, vbRed, ""

.AddPoint 35, 17, vbRed, ""
.AddPoint 37, 26, vbRed, "Red Line"
.AddPoint 30, 30, vbRed, ""
.AddPoint 0, 0, vbGreen, "Green Line"
.AddPoint 30, 20, vbGreen, ""
.GraphType = dgtLine
.DrawGraph
End With
End Sub

Private Sub Form_Load()
DrawlineGraph
End Sub


This post has been edited by PsychoCoder: 06 March 2008 - 11:51 PM

Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:52 PM

Please use code tags :code: when posting your code :)

Also, is there an error with your code? If so what error are you getting. If it's not working right then what is it doing versus what you intend for it to do. These are all vital pieces of information we need in order to properly help you :)
Was This Post Helpful? 0
  • +
  • -

#5 bimal08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-March 08

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:52 PM

'simple line curve
Private Sub DrawlineGraph()
With Draw1
.ClearData
'Graph is a line graph
'Set the origin and axes
    .OriginY = 250
    .OriginX = 50
    .YAxisNegative = 0
    
    .YTop = 50
    .YGrad = 10
    .XTop = 50
    .XGrad = 10
.GraphType = dgtLine
.ShowGrid = True
.YAxisText = "Y Axis"
.XAxisText = "X Axis"
.AxisTextFont.Bold = True

.AddPoint 25, 3, vbRed, "Red Line"
.AddPoint 31, 1, vbRed, ""

.AddPoint 34, 3, vbRed, ""
.AddPoint 37, 9, vbRed, ""

.AddPoint 35, 17, vbRed, ""
.AddPoint 37, 26, vbRed, "Red Line"
.AddPoint 30, 30, vbRed, ""
.AddPoint 0, 0, vbGreen, "Green Line"
.AddPoint 30, 20, vbGreen, ""
.GraphType = dgtLine
.DrawGraph
End With
End Sub

Private Sub Form_Load()
DrawlineGraph
End Sub


This post has been edited by PsychoCoder: 06 March 2008 - 11:54 PM

Was This Post Helpful? 0
  • +
  • -

#6 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:53 PM

Topics merged. Dont post multiple threads with the same question
Was This Post Helpful? 0
  • +
  • -

#7 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to plot a graph in VB6

Posted 06 March 2008 - 11:55 PM

This is the third thread in the last 15 minutes you've posted regarding the same exact question. This will be your only warning, double posting is against the forum rules and is strictly enforced.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1