Wrong Data shown in TChartEditor using DateTime Values

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Messie
Newbie
Newbie
Posts: 34
Joined: Wed Apr 13, 2005 4:00 am
Location: Goettingen, Germany

Wrong Data shown in TChartEditor using DateTime Values

Post by Messie » Thu Aug 20, 2009 8:53 am

Hi,

If I add DateTime Values to the bottom axis an open a Charteditor at runtime, the x values are shown correctly but the y values show the DatTime FormatString ('hh:mm') instead of the correct data. y data points are simple integer values.

See attachment.

Any suggestion about that behavior?
TeeChart 8 pro / RAD 2009

Regards, Messie
Attachments
ChartEditor.GIF
ChartEditor.GIF (56.72 KiB) Viewed 7979 times

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

Re: Wrong Data shown in TChartEditor using DateTime Values

Post by Yeray » Fri Aug 21, 2009 10:34 am

Hi Messie,

Could you please attach a simple example project we can run as-is to reproduce the problem here?
The following code seems to work as expected here:

Code: Select all

uses Series, GanttCh;

procedure TForm1.FormCreate(Sender: TObject);
var Series1: TGanttSeries;
    i: Integer;
begin
  Series1 := TGanttSeries.Create(self);
  Chart1.AddSeries(Series1);

  for i := 0 to 9 do
    Series1.AddGantt(Now()+i, Now()+i+10, random*100);
end;
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

Messie
Newbie
Newbie
Posts: 34
Joined: Wed Apr 13, 2005 4:00 am
Location: Goettingen, Germany

Re: Wrong Data shown in TChartEditor using DateTime Values

Post by Messie » Tue Aug 25, 2009 3:47 pm

Ok, here we are.

Regards, Messie
Attachments
DateTime Problem Demo.zip
(6.01 KiB) Downloaded 544 times

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

Re: Wrong Data shown in TChartEditor using DateTime Values

Post by Yeray » Wed Aug 26, 2009 3:20 pm

Hi Messie,

I see in your project that you've changed you series' ValueFormat from #,##0.### to hh:mm at design time. Note that this is for the YValues, so here it is the explanation of your result.

If you still find problems with anything, don't hesitate to let us know.
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

Messie
Newbie
Newbie
Posts: 34
Joined: Wed Apr 13, 2005 4:00 am
Location: Goettingen, Germany

Re: Wrong Data shown in TChartEditor using DateTime Values

Post by Messie » Thu Aug 27, 2009 7:01 am

Yes, you're right. I thought that this was the correct position to set. So where can I set the format string for the DateTime X Axis?

Thanks, Ulfert

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

Re: Wrong Data shown in TChartEditor using DateTime Values

Post by Yeray » Thu Aug 27, 2009 7:52 am

Hi Messie,

To show hours:minutes in the bottom axis you should do as follows:

Code: Select all

  Series1.XValues.DateTime := true;
  Chart1.Axes.Bottom.DateTimeFormat := 'hh:mm';
Note that this is explained at the Tutorial 4 - Axis Control. You'll find tutorials and demos at TeeChart programs group.
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

Post Reply