Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

the ValueFormat of the X -axis

 Post Reply Post Reply
Author
Hideo Aoki View Drop Down
New Member
New Member
Avatar

Joined: 15 Feb 2016
Posts: 2
Post Options Post Options   Quote Hideo Aoki Quote  Post ReplyReply Direct Link To This Post Topic: the ValueFormat of the X -axis
    Posted: 15 Feb 2016 at 1:37am
hello,
In the following code , the ValueFormat of the Y -axis will change from The Befere to The After.

[Code]
  Series[0].ValueFormat := '%.1f m';
[Before]
  0.5      0.4      0.3      0.2      0.1      0
[After]
  0.5 m    0.4 m    0.3 m    0.2 m    0.1 m    0.0 m

by the way,I want to change the ValueFormat of the X -axis , too.
For example...   0 m   1 m   2 m   3 m   4 m   5 m 
How to do ?

Kind Regards,
TARO
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3567
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2016 at 1:51pm
Hi, 

When adding points, you can use one of the overloads that accepts an XAxisValue string parameter. This way, the points that are added will assign a new string to the X-Axis point. When you want to format all the points, regardless of a series, you can use the following code:

procedure TForm19.FormCreate(Sender: TObject);
begin
  AdvGDIPChartView1.Panes[0].Series[0].OnXAxisGetValue := XAxisGetVal;
end;

procedure TForm1.XAxisGetVal(Sender: TObject; Serie: TChartSerie;
  Value: double; var AValue: string);
begin
  AValue := Format('%.1f m', [value]);
end;

Kind Regards, 
Pieter
Back to Top
Hideo Aoki View Drop Down
New Member
New Member
Avatar

Joined: 15 Feb 2016
Posts: 2
Post Options Post Options   Quote Hideo Aoki Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 2016 at 1:13am
Hi Pieter,
Thank you for your explanation.
I was able to understand the content.
Kind Regards
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down