Some initializing code (made with the help given earlier in this thread):
COleDateTime tmpOleTime[2];
COleDateTimeSpan tmpOleTmSpan(0,1,0,0);
COleDateTime interval(0, 0, 0, 0, 10, 0);
tmpOleTime[0] = tmpOleTime[1] = GetDocument()->m_tTime.GetTime(); //initial time for the first value
tmpOleTime[1] = tmpOleTime[1] + tmpOleTmSpan;
m_graphLeq1h.Axes.Item("XAxis").FormatString = _T("hh:nn:ss");
m_graphLeq1h.Axes.Item("XAxis").Ticks.AutoDivisions = false;
m_graphLeq1h.Axes.Item("XAxis").Ticks.MajorDivisions = 4;
m_graphLeq1h.Axes.Item("XAxis").Discrete = true;
m_graphLeq1h.Axes.Item("XAxis").Minimum = tmpOleTime[0].m_dt;
m_graphLeq1h.Axes.Item("XAxis").Maximum = tmpOleTime[1].m_dt;
m_graphLeq1h.Axes.Item("XAxis").DiscreteBase = tmpOleTime[0].m_dt;
m_graphLeq1h.Axes.Item("XAxis").DiscreteInterval = interval;
double tenminutes = 0.0069444;
double dvalue = 0.0;
dvalue = tmpOleTime[0].m_dt;
/* this is for testing purpose to add some testdata */
for(int ix = 1; ix < 6; ix++)
{
m_graphLeq1h.Plots.Item("Plot-1").ChartXY(dvalue, 30 + ix * 10);
dvalue = tmpOleTime[0].m_dt + tenmin;
}
/*but this doesnt add anything to the graph */
To add the real data i would use this function:
m_graphLeq1h.Plots.Item("Plot-1").ChartY(doc->m_tmpLEQVector, 0.0069444);