0
I have the following chart in my Windows Form
:
I set the X axis to display Time, as shown below:
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 ?
Edit the question and enter the code you are using.
– Jéf Bueno
put the code @jbueno
– Raphael Prado de Oliveira