RefreshChartData Method Example

The following simple example refreshes the data being displayed in the Chart1, which is a HistogramChart, LineChart, or SPCBarChart object.

Chart1.RefreshChartData

The following example shows a refresh of an Enhanced Chart, LineChart1, after scroll forward of 50% is performed on the Enhanced Chart.

    Dim dtTime As Variant

    Dim dtDate As Variant

    Dim dInterval As Long

    

    ' set scroll percentage

    dInterval = LineChart1.Duration

    dInterval = dInterval * 0.5 ' 50%

    

    'scroll time

    dtTime = GeneralDataset1.FixedTime

    dtTime = DateAdd("s", dInterval, dtTime)

    HistoricalDataset1.FixedTime = dtTime

    

    ' scroll date

    dtDate = GeneralDataset1.FixedDate

    dtDate = DateAdd("s", dInterval, dtDate)

    HistoricalDataset1.FixedDate = dtDate

    

    'refresh chart

    LineChart1.RefreshChartData

The second example above requires a reference to the historical data set named “iFIX GeneralDataSet Object v 1.0 Type Library” in your VBA project.