Page 1 of 1

Strip chart what is the recomended method.

Posted: Thu Jan 03, 2008 6:00 am
by 9078696
I'm using version TeeChart6 and VB2008. This code is sufficient to to display a strip chart using components with default settings but I would prefer to have code that is optimized for speed as well.

Code: Select all

    Public x, y As Double
    Private Sub frmStripChart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AxTChart1.AddSeries(TeeChart.ESeriesClass.scLine)
        AxTChart1.Aspect.View3D = False
        AxTChart1.Axis.Bottom.Automatic = False
        AxTChart1.Axis.Bottom.AutomaticMaximum = True
        AxTChart1.Legend.Visible = False
        y = 0
        x = 0
        Timer1.Enabled = True
        Timer1.Interval = 20
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim z As Double
        y = y + 0.05
        x = x + 1
        z = Math.Sin(y)
        AxTChart1.Series(0).Add(z, "", RGB(215, 0, 0))

        AxTChart1.Axis.Bottom.Minimum = x - 1900

    End Sub
Is there a setting I should be using to automatically adjust the minimum value of the bottom axis. Is there a more appropriate method to do a strip chart?

End result I expect to display 8 analog values in real time. The faster I can get the screen to update the better. I would like to show the graph at about 1500x1000 resolution.

Posted: Thu Jan 03, 2008 9:15 am
by narcis
Hi Neutone,

I strongly recommend you to read this article and use as many suggestions here as possible. This article is written in Delphi but almost the same can be applied to the ActiveX version.

Hope this helps!