Page 1 of 1

Label control - Datetime values

Posted: Wed Oct 08, 2008 5:08 pm
by 13050294
Is it possible to force datetime axis labels to coincide with the beginning of a month or year?

I'm plotting a line series that has been defined as datetime for the horizontal axis. My data is unevenly spaced, and it spans many years. If I specify a label format of MMM-yyyy, the first axis label begins with the month of December (e.g., Dec-1987). Subsequent labels also begin with December. This is awkward. Is there a way to force the labels to coincide with the beginning of each year (e.g., Jan-1987, Jan-1988, Jan-1989, etc.)?

Posted: Thu Oct 09, 2008 8:22 am
by narcis
Hi Chris,

I can think of two options here:

1. Use GetNextAxisLabel event as in the examples here:

http://www.teechart.net/support/viewtopic.php?t=4552
http://www.teechart.net/support/viewtopic.php?t=8392

2. Use custom labels as suggested on this thread.

Hope this helps!

Posted: Tue Oct 14, 2008 12:32 am
by 13050294
Thanks for the response.

It took me a while, but I think I've found a reasonable solution using the GetNextAxisLabel event.

As a feature request, it would be nice if TeeChart would allow the user to specify the value of the first tick. This would eliminate the need for semi-complex event handlers that compute values of the tick labels. Some of the better stand-alone charting applications such as Origin (http://www.originlab.com/) allow you to specify the value of the first tick label, and it gives the user a simple way to standardize the labels. Also, I think the Chart Editor should enable the user to specify standard increments (e.g., second, minute, hour, day, year, etc.) for DateTime data.

Chris

Posted: Tue Oct 14, 2008 8:13 am
by narcis
Hi Chris,
As a feature request, it would be nice if TeeChart would allow the user to specify the value of the first tick. This would eliminate the need for semi-complex event handlers that compute values of the tick labels. Some of the better stand-alone charting applications such as Origin (http://www.originlab.com/) allow you to specify the value of the first tick label, and it gives the user a simple way to standardize the labels.
Ok, I've added this to the wish-list to be considered for inclusion in future releases.
Also, I think the Chart Editor should enable the user to specify standard increments (e.g., second, minute, hour, day, year, etc.) for DateTime data.


This is already possible. Which TeeChart version are you using?

Thanks in advance.

Posted: Tue Oct 14, 2008 3:56 pm
by 13050294
Thanks for adding the feature request.

I'm using TeeChart .Net Version 3 (right-clicking on a chart and selecting About Steema TeeChart pops up a dialog with 3.5.3146.24806 at the bottom).

After some experimenting, I see that the Chart Editor does allow the user to specify standard datetime increments. Sorry for my oversight. However, I noticed that the largest standard increment allowed is one year. Increments of 2 years, 5 years, or even 10 years would be helpful in some applications. Moreover, the Custom Increment option on the Desired Bottom Axis Increment Dialog does not appear to accept datetime intervals such as 3 hours or 2 years.

Thanks,
Chris

Posted: Wed Oct 15, 2008 9:11 am
by narcis
Hi Chris,

Ok, I've added this to the wish-list too. In the meantime you can do this programmatically.