I have multiple problems in an application plotting online data. Below are my problems -

1. MSCharts flickers if my updation time is fast (around 1 sec), I have played around with Repaint, LockWindowUpdate and Visible methods, but no positive results. Is there a better method to stop flicker?

I also tried binding mschart to MS-Access using ADO, but by using that, when mschart gets updated the chart re-size itself, which gives a very bad look to chart

2. I am having around 2000 rows of data at a time on screen, so my vertical gridlines clutter too much, is there a method to show only few grid lines, maybe every 100th or so?

3. I tried hiding the gridlines and then use API lineto and drawtext, but when i try to print the mschart, these does not get printed.. any solution?

at last please let me know which is the best method to plot online data coming at very high rate (around 100 ms)?

any help is highly appreciated


Not having used that control before I don't know what to tell you but I have plotted data before using line, circle, and pset methods of a picture box and while this is probably a bit harder to do than using a control, it does give you the ultimate control...

Just a thought

Good Luck

Thanks vb5prgrmr for the suggestion...

while i am working on your suggestion, one immediate problem i face is printing this picturebox (containing the chart)!! when i print it the picturebox gets cleared it seems !! please help.



thanks vb5prgrmr...but it didnot help...i am using the following routine to get my picturebox printed..and after printing, the picturebox is still getting cleared..is there another method?

Public Sub PrintPictureBox(Box As PictureBox, _
                        Optional X As Single = 0, _
                        Optional Y As Single = 0)
Dim rv As Long
Dim ar As Boolean

    On Error GoTo Exit_Sub

    With Box
        'Save ReDraw value
        ar = .AutoRedraw

        'Set persistance
        .AutoRedraw = True

        'Wake up printer

        'Draw controls to picture box
        rv = SendMessage(.hwnd, WM_PAINT, .hDC, 0)
        rv = SendMessage(.hwnd, WM_PRINT, .hDC, _

        'Refresh image to picture property
        .Picture = .Image

        'Copy picture to Printer
        Printer.PaintPicture .Picture, X, Y

        'Restore backcolor  (Re-load picture if picture was used)
        Box.Line (0, 0)-(.ScaleWidth, .ScaleHeight), .BackColor, BF

        'Restore ReDraw
        .AutoRedraw = ar
    End With

    If Err.Number Then MsgBox Err.Description, vbOKOnly, "Printer Error!"

End Sub

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Option Explicit

Private Sub Form_Load()
Picture1.AutoRedraw = True
End Sub

Don't turn it on and off like you are doing as it will disappear...

Good Luck

Hi vb5prgrmr,

Thanks for all the help...though autoredraw was not a problem since it never got turned off..but the problem was restoring back-colour
Box.Line (0, 0)-(.ScaleWidth, .ScaleHeight), .BackColor, BF
turning it off resolved the problem..

Thanks for all the help...


This question has already been answered. Start a new discussion instead.