473,320 Members | 1,987 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,320 software developers and data experts.

vb ms chart

1
i have written a vb code for draw the chart it is working
but it is flickering while it is run
plz give me the solution for that
i have used refresh method but it in not work

Expand|Select|Wrap|Line Numbers
  1. Dim i, k As Integer
  2.  
  3. Private Sub Command1_Click()
  4.     Timer1.Interval = 150
  5.     MSChart1.Refresh
  6. End Sub
  7.  
  8. Private Sub Command2_Click()
  9.     MSChart1.Row = 1
  10.     MSChart1.Column = 1
  11.     MSChart1.Data = 0
  12.  
  13.     MSChart1.Row = 1
  14.     MSChart1.Column = 2
  15.     MSChart1.Data = 27
  16. End Sub
  17.  
  18. Private Sub Command3_Click()
  19. For jj = 0 To 49
  20.  MSChart1.Row = i + 1
  21.     MSChart1.Column = 1
  22.     MSChart1.Data = 100 * Sin(k / 3.142)
  23.     Label3.Caption = (k / 3.14)
  24.     Label2.Caption = Sin(k / 3.14)
  25.     Label1.Caption = CInt(Rnd() * 100)
  26.    i = i + 1
  27.    k = k + 1
  28.  Next jj
  29. End Sub
  30.  
  31. Private Sub Form_Load()
  32.     i = 0
  33.     k = 0
  34.  
  35.  
  36. End Sub
  37.  
  38. Private Sub MSChart1_OLEStartDrag(Data As MSChart20Lib.DataObject, AllowedEffects As Long)
  39.  
  40. End Sub
  41.  
  42. Private Sub Timer1_Timer()
  43.    ' MSChart1.Row = i + 1
  44.    ' MSChart1.Column = 1
  45.     'MSChart1.Data = i
  46.    ' X = i
  47.   Timer1.Enabled = False
  48.     MSChart1.Row = i + 1
  49.     MSChart1.Column = 1
  50.     MSChart1.Data = 100 * Sin(k / 3.142)
  51.     Label3.Caption = (k / 3.14)
  52.     Label2.Caption = Sin(k / 3.14)
  53.     Label1.Caption = CInt(Rnd() * 100)
  54.    ' MSChart1.Refresh
  55.    MSChart1.Repaint = True
  56.  
  57.  
  58.     i = i + 1
  59.     If i > 49 Then
  60.  
  61.         For j = 1 To 49
  62.             MSChart1.Column = 1
  63.             MSChart1.Row = j + 1
  64.             temp = MSChart1.Data
  65.             MSChart1.Row = j
  66.              MSChart1.Data = temp
  67.              MSChart1.Refresh
  68.              Next j
  69.         'Timer1.Interval = 0
  70.         i = 49
  71.     End If
  72.  
  73.     k = k + 1
  74.     Timer1.Enabled = True
  75.     'MSChart1.Refresh
  76. End Sub
Feb 27 '07 #1
2 3217
vijaydiwakar
579 512MB
i have written a vb code for draw the chart it is working
but it is flickering while it is run
plz give me the solution for that
i have used refresh method but it in not work

Dim i, k As Integer

Private Sub Command1_Click()
Timer1.Interval = 150
MSChart1.Refresh
End Sub

Private Sub Command2_Click()
MSChart1.Row = 1
MSChart1.Column = 1
MSChart1.Data = 0

MSChart1.Row = 1
MSChart1.Column = 2
MSChart1.Data = 27
End Sub

Private Sub Command3_Click()
For jj = 0 To 49
MSChart1.Row = i + 1
MSChart1.Column = 1
MSChart1.Data = 100 * Sin(k / 3.142)
Label3.Caption = (k / 3.14)
Label2.Caption = Sin(k / 3.14)
Label1.Caption = CInt(Rnd() * 100)
i = i + 1
k = k + 1
Next jj
End Sub

Private Sub Form_Load()
i = 0
k = 0


End Sub

Private Sub MSChart1_OLEStartDrag(Data As MSChart20Lib.DataObject, AllowedEffects As Long)

End Sub

Private Sub Timer1_Timer()
' MSChart1.Row = i + 1
' MSChart1.Column = 1
'MSChart1.Data = i
' X = i
Timer1.Enabled = False
MSChart1.Row = i + 1
MSChart1.Column = 1
MSChart1.Data = 100 * Sin(k / 3.142)
Label3.Caption = (k / 3.14)
Label2.Caption = Sin(k / 3.14)
Label1.Caption = CInt(Rnd() * 100)
' MSChart1.Refresh
MSChart1.Repaint = True


i = i + 1
If i > 49 Then

For j = 1 To 49
MSChart1.Column = 1
MSChart1.Row = j + 1
temp = MSChart1.Data
MSChart1.Row = j
MSChart1.Data = temp
MSChart1.Refresh
Next j
'Timer1.Interval = 0
i = 49
End If

k = k + 1
Timer1.Enabled = True
'MSChart1.Refresh
End Sub
Dear its genral problem in vb
vb is not that much soft as other s/w are
but still u vae to concentrate on timer
Feb 27 '07 #2
Killer42
8,435 Expert 8TB
You've got it a bit backward. Turn Repaint off before making your changes, then back on afterward. And if necessary, do a refresh at the same time.
Feb 27 '07 #3

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

Similar topics

1
by: Brian Shade | last post by:
Hi all. I am having a bit of a problem with my Perl script and the creation of a chart. I can create the chart and create a new SeriesCollection. I then specify the XValues and the Values parameter...
8
by: Prabhakar | last post by:
Friends, I have been migrating ASP applications from IIS4.0/NT4.0 to IIS5.0/W2K. All the applications working perfectly except one. This particular application will make use of asp chart object....
1
by: Jim | last post by:
I have this chart on a form. I'm trying to get this chart to render only if the user chooses to do so. This because of that the chart is quite complex and takes some time to render. I know that I...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
9
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks ...
1
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
1
by: Scott H. | last post by:
Hello: I am trying to use Crystal Reports from VS.NET 2003 to produce a simple line chart, where the x axis represents the number of measurements taken and the y axis represents the range of...
1
by: Saintor | last post by:
This is for A97 in runtime or MDE mode. My intent was to define a temporary query using the recordsetclone property / filter / orderby. The controlsource of my chart would be based on a grouped...
1
by: cubekid | last post by:
I am using OWC 11 in my new web application for displaying charts. Is it possible in OWC 11 to combine and display a column and a line graph (Looking like they overlap each other)? I tried it using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.