Suggestion: TAG property to TChartAxis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jays
Newbie
Newbie
Posts: 8
Joined: Wed Dec 15, 2010 12:00 am

Suggestion: TAG property to TChartAxis

Post by Jays » Thu Jul 21, 2011 11:46 am

Hello,

since I always have the same problem connecting any information to a TChartAxis I want to suggest adding a published TAG or DATA (Integer) property to the TChartAxis Class.

With this tag I could add my own objects to the axis. A great help whenever you want to find the corresponding axis to connect grouped series.

Example how you could use this tag for detecting the correct axis to connect a series to:

If TMyObject(mychart.customaxes.tag).PhysUnit = Searchunit then
MyLineSeries.customvertaxis:=mychart.customaxes;

My be you could take this idea into account for the future?

thanks
Jo

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Suggestion: TAG property to TChartAxis

Post by Yeray » Fri Jul 22, 2011 2:26 pm

Hello Jo,

I've added it to the wish list to be investigated for inclusion in future releases (TV52015673).
In the meanwhile, I think you shouldn't find too much problems on inheriting from TChartAxis and add the "Tag" property yourself. For example:

Code: Select all

uses Series;

type MyAxis=class(TChartAxis)
  private
    Tag: Integer;
  public
    Constructor Create(Collection:TCollection); override;
end;

{ MyAxis }
constructor MyAxis.Create(Collection: TCollection);
begin
  inherited;
  Tag:=-1;
end;

procedure TForm1.FormCreate(Sender: TObject);
var axis1: MyAxis;
begin
  Chart1.MarginLeft:=10;
  Chart1.View3D:=false;
  Chart1.AddSeries(TFastLineSeries).FillSampleValues();

  axis1:=MyAxis.Create(Chart1);
  Chart1[0].CustomVertAxis:=axis1;
  axis1.Tag:=5;

  axis1.Title.Caption:='my custom axis with tag=' + IntToStr(axis1.Tag);
  axis1.Title.Angle:=90;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Jays
Newbie
Newbie
Posts: 8
Joined: Wed Dec 15, 2010 12:00 am

Re: Suggestion: TAG property to TChartAxis

Post by Jays » Fri Jul 22, 2011 2:41 pm

Right. That's the way I did it in the past. Thank you!

Jays

Post Reply