Making Axis show Min:Sec

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
PBM Stressmedicine
Newbie
Newbie
Posts: 7
Joined: Wed Nov 08, 2006 12:00 am

Making Axis show Min:Sec

Post by PBM Stressmedicine » Mon Nov 20, 2006 1:37 pm

Hi!

We have a graph that is (currently) displaying the time (X-axis) in seconds, however it would be more suitable if it would display it as minutes and seconds in the format MM:SS (possibly HH:MM:SS). Is there a way to achieve this?

The way we add (unlabeled) points (Line is a Steema.TeeChart.Styles.FastLine):

Code: Select all

Line.Add(NewTimeInSeconds, NewValue)
Currently we have tried adding labels to each point which is simply a string formatted in the desired way, however this approach has some flaws:

¤ The labels are only shown at the points, not "forward" in time (on the axis)
¤ The labels appear at irregular intervals (probably due to the different lengths of the string, pixel-wise)
¤ If zooming in many labels with the same string are repeated (points near each other get the same string since they are displayed as seconds but the resolution is in milliseconds).

The way we add labels (Line is a Steema.TeeChart.Styles.FastLine):

Code: Select all

Line.Add(NewTimeInSeconds, NewValue, "" & Int(Int(NewTimeInSeconds) / 60) & ":" & (Int(NewTimeInSeconds) Mod 60))
We'd be grateful for any help/suggestions.

/Magnus

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 20, 2006 2:07 pm

Hi Magnus,

Please read Tutorial 4 - Axis Control. There you'll find an answer to most of your questions. You'll find the tutorials at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

PBM Stressmedicine
Newbie
Newbie
Posts: 7
Joined: Wed Nov 08, 2006 12:00 am

Post by PBM Stressmedicine » Tue Nov 21, 2006 4:28 pm

That tutorial mentioned mainly two things: Labels and Dates.

Labels:
I've already tried with labels and faced the problems explained in the post above. They get displayed at irregular intervals (like 00:01 00:02 00:04 00:05) and get repeated when zoomed in (like 00:01 00:01 00:01 00:02 00:02).

Date:
From what I have tested these are very chunky to work with. Dates are not relative measurements (they are absolute) and are thus not good to work with as a time axis.

I'd appreciate a bit more concrete suggestion on what to do, if possible at all.

/Magnus

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 22, 2006 9:26 am

Hi Magnus,
Labels:
I've already tried with labels and faced the problems explained in the post above. They get displayed at irregular intervals (like 00:01 00:02 00:04 00:05) and get repeated when zoomed in (like 00:01 00:01 00:01 00:02 00:02).
To avoid the labels being repeated you can try setting the axis increment, for example:

Code: Select all

			tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneSecond);
Date:
From what I have tested these are very chunky to work with. Dates are not relative measurements (they are absolute) and are thus not good to work with as a time axis.
Which is the exact problem you have with dates?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply