In the program, I use fastline series to draw data received from my HW.
I works well in 8.0 but does not in 2014.
in 2014, series is not updated when I call AddRealTime().
I tested this and found that if I set setMinMax() to bottom axis, update does not work or rarely called.
I set Tchart as below
Code: Select all
m_chart.ClearChart();
m_chart.GetAspect().SetView3D(false);
m_chart.AddSeries(scFastLine);
m_chart.GetAxis().GetBottom().SetAutomatic(FALSE);
m_chart.GetAxis().GetBottom().SetMaximum(10);
m_chart.GetAxis().GetLeft().SetAutomatic(FALSE);
m_chart.GetAxis().GetLeft().SetMinMax(-10, 10);
and call addRealTime in timer function
void CTChart2015TestDlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
m_chart.Series(0).GetAsFastLine().AddRealTime(float(m_nCount)/30, sinf(float(m_nCount)), NULL, 0);
//m_chart.Series(0).GetAsFastLine().
m_nCount++;
CDialogEx::OnTimer(nIDEvent);
}