Page 1 of 1

Making Axis show Min:Sec

Posted: Mon Nov 20, 2006 1:37 pm
by 9643016
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

Posted: Mon Nov 20, 2006 2:07 pm
by narcis
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.

Posted: Tue Nov 21, 2006 4:28 pm
by 9643016
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

Posted: Wed Nov 22, 2006 9:26 am
by narcis
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?