DateTime bottom axis problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
alexiat
Newbie
Newbie
Posts: 5
Joined: Tue Aug 26, 2008 12:00 am

DateTime bottom axis problem

Post by alexiat » Mon Apr 19, 2010 1:40 pm

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.
Attachments
graph.jpg
Picture of my problem
graph.jpg (14.23 KiB) Viewed 10586 times

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

Re: DateTime bottom axis problem

Post by Narcís » Mon Apr 19, 2010 2:37 pm

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.
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

alexiat
Newbie
Newbie
Posts: 5
Joined: Tue Aug 26, 2008 12:00 am

Re: DateTime bottom axis problem

Post by alexiat » Mon Apr 19, 2010 3:16 pm

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.
Attachments
GraphExample.zip
Example Project
(2.57 KiB) Downloaded 658 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: DateTime bottom axis problem

Post by Yeray » Tue Apr 20, 2010 2:40 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

alexiat
Newbie
Newbie
Posts: 5
Joined: Tue Aug 26, 2008 12:00 am

Re: DateTime bottom axis problem

Post by alexiat » Tue Apr 20, 2010 2:51 pm

Thank you for your insight and advice. I really appreciate it.

SSWang
Newbie
Newbie
Posts: 10
Joined: Mon Mar 14, 2011 12:00 am

Re: DateTime bottom axis problem

Post by SSWang » Fri Jul 08, 2011 5:10 am

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.

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

Re: DateTime bottom axis problem

Post by Narcís » Fri Jul 08, 2011 9:35 am

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.
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