Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ms chart control flickering - somebody please help me

mardmard Member Posts: 6
[b][red]This message was edited by mard at 2002-10-19 6:18:55[/red][/b][hr]
im using the mschart control to display a graph 2d-line consisting of 100 values (not 100 lines). but it's always flickering when im redrawing the graph. (redrawing every 500ms) is there anything i can do about? a trick with api? or another control?

i already tried to draw the graph with a picturebox, but there are many features i realy need from the mschat control so...

this is that code now looks like:

sub timer
Dim i As Integer

For i = 1 To maxzahl - 1
werte(i) = werte(i + 1)
Next i

werte(maxzahl) = Int((80 - 50 + 1) * Rnd + 50)
Debug.Print werte(maxzahl)

For i = 1 To maxzahl
crt_chart.Row = i
crt_chart.Data = werte(i)
Next i
end sub

Comments

  • infidelinfidel Member Posts: 2,900
    : im using the mschart control to display a graph 2d-line consisting of 100 values (not 100 lines). but it's always flickering when im redrawing the graph. (redrawing every 500ms) is there anything i can do about? a trick with api? or another control?

    I've never used the mschart control, but I've had similar issues with the flexgrid control. There should be a "Redraw" property or something similar which you can set to False, then do your drawing, then set to True again. The trick is to get the control to NOT do a refresh after every draw event, which is causing the flickering. You can also set Visible = False to accomplish the same thing.
  • lionblionb Member Posts: 1,688 ✭✭
    You can also set Visible = False to accomplish the same thing.
    :
    That's what I did working with MS Chart.
  • mardmard Member Posts: 6
    oh yeah, i've already done this, but that doesnt work. do you know a 2d-chart applet i could use instead? perhaps a free active-x control? ;-)

  • lionblionb Member Posts: 1,688 ✭✭
    : oh yeah, i've already done this, but that doesnt work. :
    You done what? Change Visual property to False/True? Or you tried to set Repaint property to False/True like infidel said about Redraw property?
  • mardmard Member Posts: 6
    i tried both.
    set visual to false, add the new data to the chart and set visible true.
    AND
    set repaint to false, add the new data to the chart and set repaint to true.



    Private Sub Timer1_Timer()
    'crt_chart.Repaint = False

    Dim i As Integer

    For i = 1 To maxzahl - 1
    werte(i) = werte(i + 1)
    Next i

    werte(maxzahl) = Int((80 - 50 + 1) * Rnd + 50)

    Debug.Print werte(maxzahl)

    For i = 1 To maxzahl
    crt_chart.Row = i
    crt_chart.Data = werte(i)
    Next i
    'crt_chart.Repaint = True

    End Sub
  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ____ < http://forcoder.org /> free video tutorials and ebooks about || Swift, Ruby, C, Python, Visual Basic .NET, Delphi, C#, Scratch, C++, Perl, JavaScript, Assembly, Visual Basic, Java, MATLAB, PHP, PL/SQL, R, Objective-C, Go Fortran, Scala, Scheme, Rust, Ada, Logo, Julia, F#, D, LabVIEW, ABAP, Hack, Kotlin, COBOL, Lisp, Crystal, Bash, SAS, VBScript, Awk, Clojure, Apex, Lua, Prolog, Dart, FoxPro, Erlang, Alice, Transact-SQL, ML || ____

Sign In or Register to comment.