Page 1 of 1

How to set custom label items texts ??

Posted: Thu Mar 10, 2016 5:43 pm
by 16477805
For testing purposes I wanted to change the label texts of TChart bottom axis to custom ones, so I wrote this code, but
that didn't change the bottom labels in any way ?? What could be wrong here ??

Code: Select all

procedure TFormVertikale.Chart1BeforeDrawAxes(Sender: TObject);
var
  chart: TChart;
  AxisItem: TAxisItem;
  i: integer;
begin
  chart:=TChart(Sender);
  for i := 0 to chart.Axes.Bottom.Items.Count-1 do
  begin
    AxisItem:=chart.Axes.Bottom.Items[i];
    AxisItem.Text:='5';
  end;
end;
Thx in advance.

Re: How to set custom label items texts ??

Posted: Fri Mar 11, 2016 4:11 pm
by yeray
Hello,

Have you tried at OnGetAxisLabel event?

Re: How to set custom label items texts ??

Posted: Sat Mar 12, 2016 10:59 am
by 16477805
Yes, in event OnGetAxisLabel() I can change my axis labels without any problems :o)

You are right :o)

Can you help me also with the panning issue, it is a RAD Studio problem, or a TeeChart problem ?
I want to write my own Pan handler with Gestures.

Thank you very much.

Re: How to set custom label items texts ??

Posted: Mon Mar 14, 2016 3:52 pm
by yeray
Hello,
BugTrapper wrote:Yes, in event OnGetAxisLabel() I can change my axis labels without any problems :o)

You are right :o)
Great!
BugTrapper wrote:Can you help me also with the panning issue, it is a RAD Studio problem, or a TeeChart problem ?
I want to write my own Pan handler with Gestures.
Please, let's continue the conversation at the according thread:
http://www.teechart.net/support/viewtop ... 021#p71021