Hey
I have a TDBChart with 2 main series (one bound to the left axis, one to the right one). They both have the same X-axis which is of TDateTime
That works fine, but there are 2 things I would add
1. I need some more information in the BottomLabel. I need also the power (Leistung in screenshot) at every label. This value belongs to the one at the same postion in our table (red values are faked on this picture)
2. Is it possible to format TDateTime as mm:ss only? Now it's hh:mm:ss, but I don't need to show hours
I hope, someone may help me solving this problem. I'm using TeeChart Pro 6.01 (if this information is needed)
Thanks lot
Need more information on axis label
Hi.
Re #1 : One way to do this is to store complete infomation in series XLabels string array and then use it for axis labels. Example:
Another approach you might explore is using chart OnGetAxisLabel event to customize individual axis labels (this includes color, text, ...) I think there is an example of this available in TeeChart demo (under "Axis" node).
You could also increase bottom margin and then manually draw requried texts directly on chart canvas in it's OnAfterDraw event.
Re #2 :This one is easy <g>. Here is the code:
Re #1 : One way to do this is to store complete infomation in series XLabels string array and then use it for axis labels. Example:
Code: Select all
var ctime: TTime;
begin
Series1.Clear;
// Point #1
ctime := EncodeTime(2,3,0,0);
Series1.AddXY(ctime,160,'160V ' + TimeToStr(ctime));
// Point #2
ctime := EncodeTime(5,0,0,0);
Series1.AddXY(ctime,119,'119V ' + TimeToStr(ctime));
// Point #3
ctime := EncodeTime(6,2,0,0);
Series1.AddXY(ctime,52,'52V ' + TimeToStr(ctime));
Series1.XValues.DateTime := True;
Chart1.Axes.Bottom.LabelsAngle := 90;
Chart1.Axes.Bottom.DateTimeFormat := 'mm:ss';
end;
You could also increase bottom margin and then manually draw requried texts directly on chart canvas in it's OnAfterDraw event.
Re #2 :This one is easy <g>. Here is the code:
Code: Select all
Chart1.Axes.Bottom.DateTimeFormat := 'mm:ss';
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Newbie
- Posts: 5
- Joined: Thu Nov 27, 2003 5:00 am
-
- Newbie
- Posts: 71
- Joined: Fri Jul 02, 2004 4:00 am
- Location: Culver City
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
You can change the font color using:
You can change the font color using:
Code: Select all
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
Sender.LabelsFont.Color:=clRed;
end;
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 |