Jump to content
Software FX Community

Re: Grid not Synchronised with the chart


User (Legacy)

Recommended Posts

Thank you for your reply, 

Yes, the Data - Editor is not synchronised with the Chart.

This is what I am doing.

I have set the following properties for my real time chart.

// Set the mask to instruct the chart to track the mouse and to evenly

space the x axis

m_spChartFX->TypeMask = (CfxType) (m_spChartFX->TypeMask | CT_TRACKMOUSE |

CT_EVENSPACING);

// Set the real time style for the chart

m_spChartFX->RealTimeStyle = (CfxRealTimeStyle) (m_spChartFX->RealTimeStyle

| CRT_LOOPPOS | CRT_NOWAITARROW);

m_spChartFX->PutTypeEx(CTE_NOLEGINVALIDATE);

// Put a scrollbar for the chart (x axis scrollbar)

m_spChartFX->PutScrollable(true);

// Recalculate the new XMin and XMax values whenever a new value is added

to the chart

m_axisX->PutAutoScale(true);

I then set a timer that runs every 1 second and I just insert some random

data into a series as follows:

N.B. m_traceVariables is an array (CSimpleArray in ATL) of the series that

I have configured for the present chart, and the m_item member in this array

is the unique id for the series, i.e. numbers from 0 - n.

m_spChartFX->OpenDataEx((CfxCod) (COD_VALUES | COD_ADDPOINTS),

m_traceVariables.GetSize(), 1);

// Loop throug all configured series and add the data point.

for (short i = 0; i < m_traceVariables.GetSize(); i++) {

m_traceVariables[i]->m_value = rand() % 100;

// Add the new data point for the series.

m_spChartFX->ValueEx[m_traceVariables[i]->m_item][0] =

m_traceVariables[i]->m_value;

}

// Closing the data channel using COD_SMOOTH will stop screen flickering

m_spChartFX->CloseData((CfxCod) (COD_VALUES | COD_REALTIME | COD_SMOOTH |

COD_REALTIMESCROLL));

When I display the Data - Editor as this chart is scrolling, the last value

I added could be 39 but the Data-Editor will show the value for point 39 as

point 40. It seems to me that the Data-Editor has an n+1 symptom for it

column display.

I tried the MFC sample provided with the Chart but the real time chart seems

to be limited to 20 points and the data in the Data Editor does not scroll.

Actually, on this point, the reason that I have set my Chart to unlimited is

that I need to display say 15 points, but I would like the Chart to cache

upto say 1000 points so that the user may easily scroll back in time. When

I tried doing this using a limited real time chart, the chart formatted

itself to display all 1000 points on the screen. Is there a way I can have

the chart store more data than I would like it to display without using an

unlimited real time chart, since I noticed that from the documentation and

for the sake of memory efficieny a limited real time chart would be more

ideal for my implementation.

Your help is appreciated.

Frank Cammaroto

Francisco Padron wrote in message ...

>You mean the Data-Editor ? can you please explain a little more.

>

>Also, does this happen with the Real-Time sample provided.

>

>Frank

>SFX

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...