SubAxis?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

SubAxis?

Post by Steve Maughan » Tue Nov 19, 2013 10:03 pm

I'd like to try the new SubAxis functionality but I wasn't able to find any examples or documentation.

Any pointer?

For example, how would you add a year and month bottom and subaxis?

Thanks,

Steve

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

Re: SubAxis?

Post by Narcís » Wed Nov 20, 2013 8:57 am

Hi Steve,

You are right, we need to publish some example about new functionality. We are preparing them but we didn't want to delay the release for XE5 until the examples were ready.

Back on the subject, there is some overview information in the Whats New? page, search for SubAxes. A simple code example to achieve what you request would be this:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var
  Years : TChartAxis;
begin
  Chart1.AddSeries(TFastLineSeries).FillSampleValues(10000);
  Chart1[0].XValues.DateTime:=True;

  Chart1.View3D:=False;

  Chart1.Axes.Bottom.Increment:=DateTimeStep[dtOneMonth];
  Chart1.Axes.Bottom.DateTimeFormat:='mm';
  //Chart1.Axes.Bottom.Items.Format.Transparent:=True;

  Years:=Chart1.Axes.Bottom.SubAxes.Add;
  Years.Increment:=DateTimeStep[dtOneYear];
  Years.DateTimeFormat:='yyyy';
  Years.Visible:=True;
end;
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

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: SubAxis?

Post by Steve Maughan » Wed Nov 20, 2013 12:59 pm

Awesome - will try it out now!

Steve Maughan
Newbie
Newbie
Posts: 48
Joined: Tue Aug 03, 2010 12:00 am

Re: SubAxis?

Post by Steve Maughan » Wed Nov 20, 2013 2:40 pm

So when Axis.DateTime = true do you add points as XY points?

Thanks,

Steve

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

Re: SubAxis?

Post by Narcís » Wed Nov 20, 2013 2:54 pm

Hi Steve,

Yes, X values will be interpreted as TDateTime values though. You'll find some more details in tutorial 4. Tutorials can be found at TeeChart's program group created by the binary installers.
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