Making Axis show Min:Sec
Posted: 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):
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):
We'd be grateful for any help/suggestions.
/Magnus
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)
¤ 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))
/Magnus