BCGControlBar Pro for MFC
virtual void CBCGPChartSeries::EnableHistoryMode ( BOOL  bEnable,
int  nHistoryDepth = 1000,
BOOL  bReverseOrder = FALSE,
BOOL  bSetDefaultValue = FALSE,
double  dblDefaultYValue = 0. 
)
virtual

Enables "history" mode for any series.

Call this function to enable "history" mode for any series. In "history" mode you specify a "history depth", which means how many data points is kept in a series. When the depth is reached, the oldest data point is removed every time a new data point has been added. With this mode you can create real time charts of any type.

It's not recommended to combine real-time and static charts.

In "history" mode a series sets the X axis to display the newest data point (e.g calls CBCGPChartAxis::SetMaximumValue), therefore you see the effect of moving chart (from left to right; set reverse order for X axis to move the chart from right to left). If you need to keep the data coming, but also allow scrolling to review the history, call CBCGPChartSeries::EnableUpdateAxesOnNewData with FALSE. When axis update is disabled you can scroll and zoom a chart as usual.

In "history" mode X axis must work with a fixed major unit (fixed major unit is automatically set to 1., but can be changed with CBCGPChartAxis::SetFixedMajorUnit). Also you can set a fixed grid size for X axis (CBCGPChartAxis::SetFixedIntervalWidth). In this mode major units will be drawn according to specified interval width (in pixels) and each unit will display the specified number of chart values.

Note. CBCGPChartHistoricalLineSeries always works in "history" mode, there is no need to call this method for this series.

History mode can't be enabled for series working in "optimized long data mode", which is turned on automatically when you call AddDataPointsOptimized().

Parameters
bEnableEnables or diables history mode.
nHistoryDepthSpecifies history depth.
bReverseOrderSpecifies how the values are added and removed from a series. If this parameter is TRUE, the values are set at the beginning of series.
bSetDefaultValueSpecifies whether to fill the history with a default value.
dblDefaultYValueSpecifies a default value to set the history to.