Search code examples
c++buildervclteechart

C++ TeeChart X-Axis apply time as value that increase


I recieve temperature from a climateboard. This values I put for y-axis for every second:

if(GetTickCount()-start_time>=1000)
{
    start_time = GetTickCount();
    DlgMainWindow->ChartTemperatureCurve->Series[0]->AddY(ConnectionThread->CurrentTemperature/10.0, "", clBlue);
}

The X-Axis protocols the time. It works for every second. But it doesn´t look very fine, cause after a minute i get 61 seconds and so on.

enter image description here

Is there a possibility to change the value of x-Axis? When i try to change the properties and change to ge DateTime, i recieve date but not the time.

enter image description here

Formats to hh:mm:ss changes the y-value but not the x-value like i need. And can i get the time, i start the measurement? So if I start with 11:51:10 --> this would be the Start-Value and every measurement value would continue --> 11:51:11 and so on.


Solution

  • it was so simple and I didn´t recognize it:

    if(GetTickCount()-start_time>=1000)
    {
        AnsiString DateAndTime = FormatDateTime("hh:nn:ss", Now());
        start_time = GetTickCount();
        DlgMainWindow->ChartTemperatureCurve->Series[0]->AddY(ConnectionThread->CurrentTemperature/10.0, DateAndTime, clBlue);
    }