Page 1 of 1

internationalization

Posted: Tue Mar 20, 2007 1:22 pm
by 8438518
Hello,

I need the numbers on both the X and Y axis displayed in the European format 0,12 as instead of 0.12

Can anyone tell me how I go about doing this?

regards,
Jeff

Posted: Tue Mar 20, 2007 2:59 pm
by narcis
Hello Jeff,

Have you tried using Delphi's DecimalSeparator variable?

Code: Select all

  DecimalSeparator:=',';

Posted: Tue Mar 20, 2007 3:12 pm
by 8438518
Hi Narcís,

I'm using TChart in C++ Builder. Does this still apply?

Thanks,
Jeff.

Posted: Tue Mar 20, 2007 3:19 pm
by narcis
Hi Jeff,

Yes, try this:

Code: Select all

        DecimalSeparator = ',';

Posted: Tue Mar 20, 2007 3:26 pm
by 8438518
Hi Narcís,

I tried DecimalSeparator = ',';
but still not working. Do you have any advice on where I should set this variable?

Thanks,
Jeff

Posted: Tue Mar 20, 2007 3:36 pm
by narcis
Hi Jeff,

You can use DecimalSeparator in OnFormCreate event, for example. Another option would be setting axes labels format as told in Tutorial 4 - Axis Control. You'll find the tutorials at TeeChart's program group.

Posted: Tue Mar 20, 2007 5:10 pm
by 8438518
Hi Narcís,

Actually the DecimalSeperator works on the Left Axis but not with data on the BottomAxis. As far as I am aware properties for both axis are the same :-(

Actually, the Left axis gets formatted ok i.e. with commas ',' and to three decimal places but no transformation is happening on the bottom axis at all. Numbers coming out like 0.1295423 I would have though AxisValuesFormat property would have solved this.

Any further ideas?

Thanks,
Jeff

Posted: Mon Mar 26, 2007 10:28 am
by Pep
Hi Jeff,

having as "." as Decimal separator and "," as Digit grouping in the Control Panel, using the following code I'm able to see all the axes labels formatted with comma between numbers :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  DecimalSeparator:=',';

  with Chart1.Axes do
  begin
    Left.Increment := 0.001;
    Left.AxisValuesFormat:='#.00';
    Bottom.AxisValuesFormat:='#.0000';
    Bottom.LabelStyle:=talValue;
  end;

  Series1.AddXY(1.1234,10.1121,'ss',clteecolor);
end;