Dear Steema Support,
I am using the following code to customize bottom axis labels:
AHost.BottomAxis.Items.Add(0, '9:00');
AHost.BottomAxis.Items.Add(60, '10:00');
AHost.BottomAxis.Items.Add(120, '11:00');
AHost.BottomAxis.Items.Add(180, '12:00');
AHost.BottomAxis.Items.Add(240, '13:00');
But after that, the added labels lose the ability to avoid overlapping to each other when the display area is crowded (by automatically setting itself's visibility to false). What can I do about it? thanks.
A question about custom label.
Re: A question about custom label.
Hello sswang,
I suggest you three different options:
First: You can do something as next code without custom labels and using DateTimeStep to define increment.
Second: Use property increment to increment bottom axis to 60 as do in next line of code:
Third: Use custom labels and control the overlap manually.
I hope will helps.
Thanks,
I suggest you three different options:
First: You can do something as next code without custom labels and using DateTimeStep to define increment.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var Series1:TAreaSeries;
begin
Series1 := TAreaSeries.Create(self);
Chart1.AddSeries(Series1);
Chart1.Align := alClient;
Series1.XValues.DateTime:=True;
Series1.AddXY(EncodeTime(9,00,00,00),100);
Series1.AddXY(EncodeTime(10,00,00,00),99);
Series1.AddXY(EncodeTime(11,00,00,00),200);
Series1.AddXY(EncodeTime(12,00,00,00),150);
Series1.AddXY(EncodeTime(13,00,00,00),189);
Chart1.Axes.Bottom.DateTimeFormat:= 'hh:mm';
Chart1.Axes.Bottom.Increment:= DateTimeStep[dtOneHour];
Code: Select all
Chart1.Axes.Bottom.Increment:=60;
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: A question about custom label.
Hi,
Thanks, I think I've got a clue...now I wonder how to use your first suggested approach without inserting visible Y values?
I mean if there is actually no data on 10 o'clock, how to make sure that the "10:00" tick and label will still be there on X-axis? Thanks again.
Thanks, I think I've got a clue...now I wonder how to use your first suggested approach without inserting visible Y values?
I mean if there is actually no data on 10 o'clock, how to make sure that the "10:00" tick and label will still be there on X-axis? Thanks again.
Re: A question about custom label.
Hi,
This is what I get, still with the axis label "10:00"
I'm not sure to understand you. If I comment the following line in Sandra's code abovesswang wrote:Thanks, I think I've got a clue...now I wonder how to use your first suggested approach without inserting visible Y values?
I mean if there is actually no data on 10 o'clock, how to make sure that the "10:00" tick and label will still be there on X-axis? Thanks again.
Code: Select all
// Series1.AddXY(EncodeTime(10,00,00,00),99);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |