Left Axis--showing thousands with 'k'

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Left Axis--showing thousands with 'k'

Post by TestAlways » Thu Jan 10, 2008 10:28 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jan 11, 2008 2:43 pm

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply