Hi,
I cannot format a datetime field to mm/yyyy or anything else format it shows full date and time.
I tried to format on the field properties at the dataset (cdsViewData), also in chart properties displaydateformat on bottom axis,
and i paste code in form event OnGetAxisLabel and in initialize form event...
But nothing works!
Please help,
Thanks a lot
Versions:
Delphi 7
Teechart Pro v8.07.70413
DateTime Format on Bottom Axis
Re: DateTime Format on Bottom Axis
Hello,
I can show dates in mm/yyyy DateTimeFormat without problems in the following simple example with Delphi 7 and TeeChart v8.08:
Maybe there's some problem in your code. Please, try to arrange a simple example project we can run as-is to reproduce the problem here and we'll be glad to take a look at it.
I can show dates in mm/yyyy DateTimeFormat without problems in the following simple example with Delphi 7 and TeeChart v8.08:
Code: Select all
uses Chart, Series, DateUtils, TeeProcs;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
var tmpDate: TDateTime;
i: Integer;
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
XValues.DateTime:=true;
tmpDate:=Today;
for i:=0 to 5 do
begin
AddXY(tmpDate, random*100);
tmpDate:=IncMonth(tmpDate);
end;
end;
Chart1.Axes.Bottom.Increment:=DateTimeStep[dtOneMonth];
Chart1.Axes.Bottom.DateTimeFormat:='mm/yyyy';
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: DateTime Format on Bottom Axis
Bottom Axis Labels are automatic from database values that is datetime field.
So, i have
Datetime,Measure
01/01/2010 11:53:00, measurevalue1
02/01/2010 11:00:00, measurevalue2 etc..
And i want to show on diagram only 'mm/yyyy' but if i make another column in database with this string like
String, Measure
01/2010, measurevalue1
01/2010, measurevalue2 etc..
then i have no average function for my measure and measure it is not sum!
Is there any solution or i have to write code for each xy value ?
Thnx
So, i have
Datetime,Measure
01/01/2010 11:53:00, measurevalue1
02/01/2010 11:00:00, measurevalue2 etc..
And i want to show on diagram only 'mm/yyyy' but if i make another column in database with this string like
String, Measure
01/2010, measurevalue1
01/2010, measurevalue2 etc..
then i have no average function for my measure and measure it is not sum!
Is there any solution or i have to write code for each xy value ?
Thnx
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: DateTime Format on Bottom Axis
Hi bsoft,
Have you set series X values to contain DateTime data? For example:
Have you set series X values to contain DateTime data? For example:
Code: Select all
Series1.XValues.DateTime:=True;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |