ms chart control flickering - somebody please help me

[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

  • : 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.
  • You can also set Visible = False to accomplish the same thing.
    :
    That's what I did working with MS Chart.
  • 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? ;-)

  • : 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?
  • 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
Sign In or Register to comment.

Howdy, Stranger!

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

Categories