Page 1 of 1
DateTime bottom axis problem
Posted: Mon Apr 19, 2010 1:40 pm
by 10549967
I have a graph of 2 series with the bottom axis as date time. I have the bottom axis as date time format as 'mm/dd hh:mm' with multi line labels set to true. The labels still display on one line. Also, I would like to show all dates one after the other without any big gaps in the graph. For instance, if the first graph date is 3/2009 and the next dates start in 2010 all the latter dates are bunched together at the right side of the graph with a large gap between the dates. I have the bottom axis set to automatic. I have attached a picture of my problem. I have tried to follow the tutorial on Axes but I can't seem to solve these problems. Can you please tell me what simple change I have to make to fix this. Thanks.
Re: DateTime bottom axis problem
Posted: Mon Apr 19, 2010 2:37 pm
by narcis
Hi alexiat,
I have a graph of 2 series with the bottom axis as date time. I have the bottom axis as date time format as 'mm/dd hh:mm' with multi line labels set to true. The labels still display on one line.
You may need to add a line break in the labels format, for example: 'mm/dd' + #13 + 'hh:mm'
Also, I would like to show all dates one after the other without any big gaps in the graph. For instance, if the first graph date is 3/2009 and the next dates start in 2010 all the latter dates are bunched together at the right side of the graph with a large gap between the dates. I have the bottom axis set to automatic. I have attached a picture of my problem. I have tried to follow the tutorial on Axes but I can't seem to solve these problems. Can you please tell me what simple change I have to make to fix this
This could be related to the labels style you set for the bottom axis. Try using different LabelStyle available. You can also try changing Increment.
If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.
Thanks in advance.
Re: DateTime bottom axis problem
Posted: Mon Apr 19, 2010 3:16 pm
by 10549967
The #13 did the trick on the labels. Attached is a project with the gap problem. I am using Delphi 2007 with Tee Chart 8.04.11395. Thanks.
Re: DateTime bottom axis problem
Posted: Tue Apr 20, 2010 2:40 pm
by yeray
Hi alexiat,
First of all, note that datetimes are, in fact, doubles. In your example, between your first and second points, there are 10 months of distance while, between the second point and the last, there are only 3 months of distance. So, I think it is logical that, in a continuous bottom axis with a regular increment, the axis should reflect this difference in distances.
If you want, for example, to have always the same distance between two consecutive points, you could add the points without XValue (so teechart will give integers to them 0, 1, 2, 3,...) and add the YValue and the label as you are doing.
Re: DateTime bottom axis problem
Posted: Tue Apr 20, 2010 2:51 pm
by 10549967
Thank you for your insight and advice. I really appreciate it.
Re: DateTime bottom axis problem
Posted: Fri Jul 08, 2011 5:10 am
by 16558750
Hi,
I am working on a candle chart to display stock quotes and is stucked on the same problem to have always the same distance between two consecutive points (there shouldn't be distance gaps every time the x-timeline hits weekends or holidays). How to achieve the same "compact display" effect with Candle Series? Thanks.
Re: DateTime bottom axis problem
Posted: Fri Jul 08, 2011 9:35 am
by narcis
Hi SSWang,
Yes, this is possible. You should do as in the All Features\Welcome!\Chart Styles\Financial\Candle (OHLC)\Axis Labels no Weekends example in the new features demo, available at TeeChart's program group.