How to get values from X axe in C#

Stéphani Pinheiro Ferreira 1 Reputation point
2021-02-09T12:04:23.67+00:00

I am working with an application that builds a graph with the temperatures recorded over time through a sensor, so that X: Time of day and Y: Temperature in C °. Very well, I can build the graph perfectly, it records the temperatures and makes the graph normally, what I need is to find a way to take the time when a certain temperature was recorded and show it on a label, for example: "The maximum temperature recorded today was 23.1 ° C at hh: mm: ss (here's the time) "

So, what I need is to take the time value on the X axis to display it on the label. Is there any way to do this?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,120 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Abdulhakim M. Elrhumi 356 Reputation points
    2021-02-09T13:10:49.27+00:00

    Hi

    {
          DateTime m_dateTime = DateTime.Now;
          string currentTime = m_dateTime.TimeOfDay.Hours + ":" + m_dateTime.TimeOfDay.Minutes + ":" + m_dateTime.TimeOfDay.Milliseconds;
          MessageBox.Show(currentTime);
        }
    

    Best Regards.
    --please don't forget to Accept as answer if the reply is helpful--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.