【问题标题】:C++ TeeChart X-Axis apply time as value that increaseC++ TeeChart X 轴应用时间作为增加的值
【发布时间】:2015-08-31 09:53:55
【问题描述】:

我从气候板接收温度。 我每秒为 y 轴设置的这个值:

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

X 轴协议时间。它适用于每一秒。但它看起来不太好,因为一分钟后我得到了 61 秒等等。

是否有可能改变 x 轴的值?当我尝试更改属性并更改为 ge DateTime 时,我收到日期而不是时间。

格式为 hh:mm:ss 会更改 y 值,但不会更改我需要的 x 值。 我能得到时间,我开始测量吗? 因此,如果我从 11:51:10 开始 --> 这将是 Start-Value 并且每个测量值都将继续 --> 11:51:11 等等。

【问题讨论】:

    标签: c++builder vcl teechart


    【解决方案1】:

    太简单了,我没认出来:

    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);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多