Urgent: Graph Creation in Vb and Form-linking

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2007
Posts: 23
Reputation: elanch is an unknown quantity at this point 
Solved Threads: 0
elanch elanch is offline Offline
Newbie Poster

Urgent: Graph Creation in Vb and Form-linking

 
0
  #1
Aug 1st, 2007
hi friends!
I need to know how to create a graph in vbasic. please send the syntax.possible with eg.
I also need to know how to link one form with another.
Thanks in advance.
elanch
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Urgent: Graph Creation in Vb and Form-linking

 
0
  #2
Aug 1st, 2007
Hi,

USe MSChart Control For the Graph.
U can also use Crystal Reports
Build Graph on Data stored in Database
To Show Another Form use :

Form2.Show

REgards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 11
Reputation: orion_nsk is an unknown quantity at this point 
Solved Threads: 0
orion_nsk's Avatar
orion_nsk orion_nsk is offline Offline
Newbie Poster

Re: Urgent: Graph Creation in Vb and Form-linking

 
0
  #3
Aug 17th, 2007
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1
Reputation: shivuait is an unknown quantity at this point 
Solved Threads: 0
shivuait shivuait is offline Offline
Newbie Poster

Graph Creation using ms graph

 
0
  #4
Feb 19th, 2008
HI,

I wants to create line graph using ms chart in vb6 form. can i know how to pass the values to chart without using database. if i know any sample code is better, thank you.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,146
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 132
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Urgent: Graph Creation in Vb and Form-linking

 
0
  #5
Feb 19th, 2008
Try to use this sample code

To use this sample, please following steps

Create a new project in VB6
Pull down the Project menu and choose Components .
Select the checkbox next to Microsoft ChartControl 6.0(OLEDB), Click OK.
Add a combobox,one Mschart control and one check box tothe existing form.
Paste in the following code tothe code window
  1. Private Sub Form_Load()
  2. 'Fill the combo box with different types of chart types.
  3. With Combo1
  4. .AddItem "3D Bar"
  5. .AddItem "2D Bar"
  6. .AddItem "3D Line"
  7. .AddItem "2D LIne"
  8. .AddItem "3D Area"
  9. .AddItem "2D Area"
  10. .AddItem "3D Step"
  11. .AddItem "2D Step"
  12. .AddItem "3D Combination"
  13. .AddItem "2D Combination"
  14. End With
  15. 'Declare 2D array to store values for the chart
  16. 'Variant ----so that can store both text as well as numbers
  17. Dim X(1 To 7, 1 To 6) As Variant
  18.  
  19. X(1, 2) = "Steel"
  20. X(1, 3) = "Aluminium"
  21. X(1, 4) = "Copper"
  22. X(1, 5) = "Buxite"
  23. X(1, 6) = "Lead"
  24.  
  25. X(2, 1) = "JAN"
  26. X(2, 2) = 2
  27. X(2, 3) = 3
  28. X(2, 4) = 4
  29. X(2, 5) = 5
  30. X(2, 6) = 6
  31.  
  32. X(3, 1) = "FEB"
  33. X(3, 2) = 4
  34. X(3, 3) = 6
  35. X(3, 4) = 3
  36. X(3, 5) = 10
  37. X(3, 6) = 18
  38.  
  39. X(4, 1) = "MAR"
  40. X(4, 2) = 1
  41. X(4, 3) = 3
  42. X(4, 4) = 8
  43. X(4, 5) = 7
  44. X(4, 6) = 9
  45.  
  46. X(5, 1) = "APR"
  47. X(5, 2) = 4
  48. X(5, 3) = 6
  49. X(5, 4) = 13
  50. X(5, 5) = 10
  51. X(5, 6) = 12
  52.  
  53. X(6, 1) = "MAY"
  54. X(6, 2) = 2
  55. X(6, 3) = 9
  56. X(6, 4) = 9
  57. X(6, 5) = 12
  58. X(6, 6) = 7
  59.  
  60. X(7, 1) = "JUN"
  61. X(7, 2) = 13
  62. X(7, 3) = 20
  63. X(7, 4) = 5
  64. X(7, 5) = 18
  65. X(7, 6) = 11
  66. '2D array is the data for the chart control.
  67. MSChart1.ChartData = X
  68. 'Default chart type is se to 2D bar chart.
  69. MSChart1.chartType = 1
  70.  
  71. End Sub
  72.  
  73. Private Sub Check1_Click()
  74. If Check1.Value = 1 Then
  75. 'Show Legends
  76. MSChart1.ShowLegend = True
  77. Check1.Caption = "&Hide Legends"
  78. Else
  79. 'Hide Legends
  80. MSChart1.ShowLegend = False
  81. Check1.Caption = "&Show Legends"
  82. End If
  83. End Sub
  84.  
  85. Private Sub Combo1_Click()
  86. 'To change the chart type at run time.
  87. MSChart1.chartType = Combo1.ListIndex
  88. End Sub

NOTE:-The above sample code works for default name of controls ,code need to be modified accordly if the name of controls are different.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 2457 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC