User (Legacy) Posted August 30, 1999 Report Share Posted August 30, 1999 Hi, I am having some difficulty using the series object. Does somebody know if I can "dynamically" add and remove series from the chart. If the answer is YES, how is it done. Here is an example of what I am trying to do: ICfxSeriesEnumPtr seriesEnumPtr = m_spChartFX->GetSeries(); // Get the new number of configured series. int numSeries = m_traceVariables.GetSize(); //add one point from the right in realtime for each series m_spChartFX->OpenDataEx((CfxCod) (COD_VALUES | COD_ADDPOINTS), numSeries, 1); long count = seriesEnumPtr->GetCount(); ATLTRACE("GetSize of array = %i, count of series = %i\n", numSeries, count); // Loop throug all configured series and add the data point. for (short i = 0; i < m_traceVariables.GetSize(); i++) { ICfxSeriesPtr seriesPtr = seriesEnumPtr->GetItem(i); This code crashes on the line seriesEnumPtr->GetItem(i); when I try to access a new series that I added to the chart. The ATLTRACE prints GetSize of array = 2, count of series = 1 So, even though I called OpenDataEx with the number of series being 2, it still seems to think that it only has 1. Do I need to call a method like AddSeries() to inform the chart that I am about to add a new series to the chart. I have read through the help files but they don't seem to answer my questions. Help is appreciated. Frank Cammaroto Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.