Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DateTime axisX in seconds
06-24-2014, 02:41 PM
Post: #1
DateTime axisX in seconds
Hello.
How to configure MajorTicks and other parameters to be displayed on the axisX DateTime range in seconds? In the example DateDisplayScopeDemo minimum time display can be set as _mDate.AddHours (1). If you set m_Date.AddSeconds (1), the labels axisX not displayed.
Find all posts by this user
Quote this message in a reply
06-24-2014, 06:49 PM
Post: #2
RE: DateTime axisX in seconds
Okay, with this question, I figured out (it was built very few points). Another question: Is it possible to put the time and date in two lines axisX, e.g.

15:32:37
24.06.2014
Find all posts by this user
Quote this message in a reply
04-03-2015, 10:18 PM
Post: #3
RE: DateTime axisX in seconds
Have you tried adding a CR and/or LF to the text?

Regards,
Dave
Quote this message in a reply
04-06-2015, 09:50 AM
Post: #4
RE: DateTime axisX in seconds
Hi , first thanks for subscribing.
I can not add the time on the x axis in the format HH : mm : ss with on precision of the second.

[Image: bFIiyS.jpg]

with the following code

Code:
public partial class Form1 : Form
    {
        public System.DateTime m_Date = System.DateTime.Now;
        private Random m_RandomGen = new Random(123);
        public Form1()
        {
            InitializeComponent();
            scope1.XAxis.CustomLabel += scope1_XAxis_CustomLabel;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            
            m_Date = m_Date.AddHours(1);  
            scope1.Channels[0].Data.AddXYPoint(m_Date.ToBinary(), m_RandomGen.NextDouble() * 2000 - 1000);
        }
        private void scope1_XAxis_CustomLabel(object sender, Mitov.PlotLab.CustomAxisLabelEventArgs Args)
        {
            Args.AxisLabel = System.DateTime.FromBinary((long)Math.Round(Args.SampleValue)).ToString("HH:mm:ss");
        }
    }
is that I'm doing something wrong. is pocible ?
Find all posts by this user
Quote this message in a reply
04-20-2015, 02:30 AM
Post: #5
RE: DateTime axisX in seconds
Hi! Which version of the labs are you using?

Regards,
Dave
Quote this message in a reply
04-20-2015, 09:54 AM (This post was last modified: 04-20-2015 09:55 AM by manutek.)
Post: #6
RE: DateTime axisX in seconds
Hi dave
I am using:
_Windows7 32bits
_VS2010
_.NET 4.0
_PlotLabs 7.6.0.0

and I can not find the cause of the problem. :-(
Find all posts by this user
Quote this message in a reply
04-25-2015, 01:46 AM
Post: #7
RE: DateTime axisX in seconds
(04-20-2015 09:54 AM)manutek Wrote:  and I can not find the cause of the problem. :-(

Hi Manutek,

Thank you!
I am sorry for the late reply, I got caught between the 7.6 release and some system problems in the last few days :-( .
The problem is that your time period is too small and is getting rounded. If you multiply it by 1000 as example it will work. You may need to reformat the date printing accordingly:

private void timer1_Tick(object sender, EventArgs e)
{

m_Date = m_Date.AddHours(1);
scope1.Channels[0].Data.AddXYPoint(m_Date.ToBinary() * 1000, m_RandomGen.NextDouble() * 2000 - 1000);
}

private void scope1_XAxis_CustomLabel(object sender, Mitov.PlotLab.CustomAxisLabelEventArgs Args)
{
Args.AxisLabel = System.DateTime.FromBinary((long)Math.Round(Args.SampleValue / 1000 )).ToString("HH:mm:ss");
}
Find all posts by this user
Quote this message in a reply
04-26-2015, 08:21 AM
Post: #8
RE: DateTime axisX in seconds
thank you very much Mr Mitov ¡¡¡¡

problem solved.
Find all posts by this user
Quote this message in a reply
03-14-2017, 09:23 AM
Post: #9
RE: DateTime axisX in seconds
How to solve it problem without m_Date = m_Date.AddHours(1) ?
With a time interval of less than one second.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)