473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to use mschart in my program

hi can anyone help me, i'm having problem with mschart. i want to draw graph according to value in the Graph_Details table.i dont know where to start writing code and how. i have 0% knowledge on mschart and the coding. can someone help me.


My code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer2_Timer()
  2. Dim myvari As Integer
  3. Dim StartTime As Integer
  4. Dim StopTime As Integer
  5. Dim Store As Integer
  6. Dim timeGap As Integer
  7. Dim TimeEnd As String
  8. Dim avgSpeed As Long
  9. Dim NoOfCars As Integer
  10.  
  11.     Counter = Counter + 1
  12.     If Counter = 300 Then
  13.         Timer2.Enabled = False
  14.  
  15.         TimeEnd = Format(Now, "hh:mm:ss")
  16.  
  17.         strSql = "SELECT MAX(TimeGap) FROM Graph_Details"
  18.  
  19.         DataRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
  20.  
  21.         If DataRs.RecordCount > 0 Then
  22.             If Not IsNull(DataRs(0)) Then
  23.                 timeGap = DataRs(0) + 1
  24.             Else
  25.                 timeGap = 1
  26.             End If
  27.         Else
  28.             timeGap = 1
  29.         End If
  30.  
  31.         DataRs.Close
  32.  
  33.         strSql = "SELECT TOP 150 TimeOut, Speed FROM Car_INFO ORDER BY ID DESC"
  34.  
  35.         'MsgBox strSql
  36.  
  37.         DataRs.Open strSql, DE.Conn, adOpenForwardOnly, adLockReadOnly
  38.  
  39.         If DataRs.RecordCount > 0 Then
  40.  
  41.         NoOfCars = 0
  42.         avgSpeed = 0
  43.  
  44.         For i = 0 To DataRs.RecordCount - 1
  45.             If Not DataRs(0) = "" Then
  46.                 NoOfCars = NoOfCars + 1
  47.                 avgSpeed = avgSpeed + DataRs(1)
  48.             End If
  49.             DataRs.MoveNext
  50.  
  51.         Next i
  52.  
  53.         avgSpeed = avgSpeed / NoOfCars
  54.  
  55.         End If
  56.  
  57.         DataRs.Close
  58.  
  59.         strSql = "INSERT INTO Graph_Details (TimeStart, TimeEnd, AverageSpeed, NoOfCars, TimeGap) " & _
  60.                     " VALUES ('" & lblTimeStart.Caption & "','" & TimeEnd & "','" & avgSpeed & "'," & _
  61.                     " '" & NoOfCars & "'," & timeGap & ")"
  62.  
  63.                     MsgBox strSql
  64.  
  65.                     DE.Conn.Execute strSql
  66.         Timer2.Enabled = True
  67.         Counter = 0
  68.         lblTimeStart.Caption = Format(Now, "hh:mm:ss")
  69.     End If
  70.  
  71. End Sub
May 6 '08 #1
1 1097
debasisdas
8,127 Expert 4TB
please find a related discussion here for reference.
May 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gerhard Swart | last post by:
Good Morning, I have a licensed .Net product. Meaning I can develop and deploy my projects. I want to use MSChart in my latest project. Now I am not sure about the licensing of MSChart. As far...
1
by: arc | last post by:
My web application is using MSChart for reporting. (until i port it to some decent reporting tool) How to make sure all the web clients (IE atleast) have MSChart on their system to view these...
1
by: Jaime Lucci | last post by:
Has anybody any documentation about MSChart? Thanks.
5
by: Richard | last post by:
I don't know any thing about c#, I really need to do this in visual c++. I don't manually wrap the dll but since it's called AxInterop.OWC10.dll I assume visual studio has done that for me. ...
0
by: Richard | last post by:
When I try adding a MSChart control from the toolbox I get an error message telling me it can't find AxInterop.OWC10.dll. I was given the advice below but i'm not sure where to add the class...
1
by: wayne | last post by:
hi, i understand that i m able to use mschart to plot a line graph. i got list of values (jus one column) to b plotted into a line graph. how ca i do it using mschart in visual c++?? thanks...
0
by: JS | last post by:
Hello I want translate a project from VB6 to VB.Net 1.0 In this project I have a graph with a MsChart COM control. When I want make reference (Projet/Ref /Com controle) to this chart I have an...
4
by: djklocek | last post by:
Hello. I'm writing a program using MSChart. On Winxp everything works fine but when I moved it to Win98 or WinMe it started to crash (not always in the same place). I didn't know the reason so i...
1
by: fblackstone | last post by:
I am trying to learn vb.net 2003. I am using mschart 5.0. Well the problem is I have no idea how to, or where to get examples of code. I am building a financial management program. So I am building a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.