Page 1 of 1

SubAxis?

Posted: Tue Nov 19, 2013 10:03 pm
by 16556683
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

Re: SubAxis?

Posted: Wed Nov 20, 2013 8:57 am
by narcis
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;

Re: SubAxis?

Posted: Wed Nov 20, 2013 12:59 pm
by 16556683
Awesome - will try it out now!

Re: SubAxis?

Posted: Wed Nov 20, 2013 2:40 pm
by 16556683
So when Axis.DateTime = true do you add points as XY points?

Thanks,

Steve

Re: SubAxis?

Posted: Wed Nov 20, 2013 2:54 pm
by narcis
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.