X-axis time of graphics C#

Asked

Viewed 147 times

0

I have the following chart in my Windows Form:

inserir a descrição da imagem aqui

I set the X axis to display Time, as shown below:

inserir a descrição da imagem aqui

Below the methods I call to draw the graph:

        private void funcaoQualquer()
        {
            while (true)
            {
                funcaoArray[funcaoArray.Length - 1] = hScrollBar1.Value;
                Array.Copy(funcaoArray, 1, funcaoArray, 0, funcaoArray.Length - 1);
                if (chart1.IsHandleCreated)
                {
                    this.Invoke((MethodInvoker)delegate { atualizaGraficoFuncaoQualquer(hScrollBar1.Value); });
                }
                else
                {
                    //...
                }
                Thread.Sleep(250);
            }
        }

        private void atualizaGraficoFuncaoQualquer(int valor)
        {
            for (int i = 0; i < funcaoArray.Length - 1; ++i)
            {
                chart1.Series["Series1"].Points.Add(valor);
            }
        }

But when drawing the graph and over time, the x-axis does not change the values. I think it is being displayed as hours. How do I change to minutes or seconds ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.