Page 1 of 1

Time formatting for axis

Posted: Thu Feb 01, 2007 2:30 am
by 9637403
It appears there is a minor problem with time formatting on an axis. I want the time to be represented using a single digit for hour e.g. 1:15:45 not 01:15:45. This should be achievable using a format of h:mm:ss however this doesn't work. To get it to work a space needs to be inserted before the h e.g. _h:mm:ss where _ is space.

Posted: Thu Feb 01, 2007 11:38 am
by 9348258
Hi Adrian,

Which TeeChart version are you using?
It works fine here using latest release (Build 2.0.2586.24038)

Can you see if in your version the below code, it's woorking fine, please ?

Code: Select all

	private void Form1_Load(object sender, EventArgs e)
        {
            bar1.XValues.DateTime = true;

            tChart1.Axes.Bottom.Labels.DateTimeFormat = "h:mm:ss";
            
            DateTime[] dates = new DateTime[5];

            dates[0] = Convert.ToDateTime("1/1/07 07:00:00");
            dates[1] = Convert.ToDateTime("1/1/07 08:00:00");
            dates[2] = Convert.ToDateTime("1/1/07 09:00:00");
            dates[3] = Convert.ToDateTime("1/1/07 10:00:00");
            dates[4] = Convert.ToDateTime("1/1/07 11:00:00");

            for (int i = 0; i < 5; i++)
            {
                bar1.Add(dates[i], i);                
            }

            
        }

Posted: Thu Feb 01, 2007 10:23 pm
by 9637403
I'm using the Jan30th build... sorry my dev machine is down at the moment and I cant check the version. I'm trying to set the format using the chart editor... it definately doesn't work with just the single h needs a space and the h.

Posted: Fri Feb 02, 2007 9:19 am
by 9348258
Hi Adrian

Here it's working fine using the Jan30th build at run-time and design-time. could you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can post your files either at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup or at our upload page.

Thanks in advance.