Page 1 of 1

Left Axis--showing thousands with 'k'

Posted: Thu Jan 10, 2008 10:28 pm
by 10546565
Is it possible to show a 'k' in place of ',000' on a left axis--to reduce the required width of the axis label? I.E., rather then showing $100,000, I want to show $100k.

Note that I've tried the OnGetAxisLabel, the problem there is that screen size is a premium and the chart uses the width for the label without consideration of the smaller size.

Posted: Fri Jan 11, 2008 2:43 pm
by narcis
Hi TestAlways,

In that case you can either add labels like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
    val: double;
begin
  for i:=0 to 10 do
  begin
    val:=100000*(i+1);
    Series1.Add(val,'$'+FloatToStr(val/1000)+'k');
  end;

  Chart1.Axes.Left.LabelStyle:=talText;
  Chart1.Axes.Bottom.LabelStyle:=talValue;
end;
Or use custom axis labels as shown in the example at All Features\Welcome!\Axes\Labels\Custom labels