Automatic bottom axes
Posted: Thu Mar 04, 2010 10:52 am
Hi,
I need a graph that will always show the last 15 minutes of the data. In order to achieve it on every insert i update the Minimum and the Maximum
This is the code:
DateTime endTime = DateTime.UtcNow;
DateTime startTime = endTime.Subtract(new TimeSpan(0, 15, 0));
tchart.Axes.Bottom.Minimum = endTime.ToOADate();
tchart.Axes.Bottom.Maximum = startTime.ToOADate();
Can i do it automatically ?
Also, i need the offset (tchart.Axes.Left.MaximumOffset = 50; tchart.Axes.Left.MinimumOffset = 50;) to be only on the values of the last 15 minutes.
If i set it at the beginning it won't be accurate because the minimum and the maximum of the last 15 minutes always changing.
How can i achieve it?
Thanks,
Ofer
I need a graph that will always show the last 15 minutes of the data. In order to achieve it on every insert i update the Minimum and the Maximum
This is the code:
DateTime endTime = DateTime.UtcNow;
DateTime startTime = endTime.Subtract(new TimeSpan(0, 15, 0));
tchart.Axes.Bottom.Minimum = endTime.ToOADate();
tchart.Axes.Bottom.Maximum = startTime.ToOADate();
Can i do it automatically ?
Also, i need the offset (tchart.Axes.Left.MaximumOffset = 50; tchart.Axes.Left.MinimumOffset = 50;) to be only on the values of the last 15 minutes.
If i set it at the beginning it won't be accurate because the minimum and the maximum of the last 15 minutes always changing.
How can i achieve it?
Thanks,
Ofer