Page 1 of 1

Margins for Annotation

Posted: Thu Oct 22, 2009 11:48 am
by 10545590
Hi !

I really miss a feature for the annotations - margins.

If you set the position you can only choose an Auto mode like "Right top" Left top" ... or you choose "Custom".
In most cases the Auto selection is ok, but it would be great to set some margins even if it is set to auto mode.

I know it is possible to control the position of the annotation manually, but it would be nicer if this could be done by TChart directly.

So what do you think about that suggestion?

Greetz Dominik

Re: Margins for Annotation

Posted: Thu Oct 22, 2009 2:15 pm
by yeray
Hi Dominik,

I'll add this to the wish list but (TV52014508), as you know, this is quite easy to do manually. For example:

Code: Select all

uses teetools;

var annotation1: TAnnotationTool;

procedure TForm1.FormCreate(Sender: TObject);
begin
  annotation1:=Chart1.Tools.Add(TAnnotationTool.Create(self)) as TAnnotationTool;
  annotation1.Position:=ppLeftTop;
  annotation1.Text:='Annotation with margin';
end;

procedure TForm1.Button1Click(Sender: TObject);
var LeftMargin, TopMargin, tmpLeft, tmpTop: Integer;
begin
  LeftMargin:=10;
  TopMargin:=10;
  tmpLeft:=annotation1.Bounds.Left;
  tmpTop:=annotation1.Bounds.Top;
  annotation1.PositionUnits:=muPixels;
  annotation1.Shape.Left:=tmpLeft+LeftMargin;
  annotation1.Shape.Top:=tmpTop+TopMargin;
end;

Re: Margins for Annotation

Posted: Fri Oct 23, 2009 5:53 am
by 10545590
Hi Yeray,
this is quite easy to do manually
For sure. This is an easy task.

But we have one problem ... We store the TEE file in a Stream. If we load it back the values for the margins are gone:

Code: Select all

  LeftMargin:=10;
  TopMargin:=10;
We had to store this information by ourself.

And on the other side we got the same "problem" after loading. We have to read the values and set the margins to a new value.
Another probloem is while resizing the chart. We have to manually control all the positions of annotations.

So there are a lot of things to do which will better done by TChart itself.

Re: Margins for Annotation

Posted: Fri Oct 23, 2009 8:03 am
by yeray
Hi Dominik,

Yes, I understand that's annoying to do this job manually. I only wanted to clarify that there is a way to do it while it's not included in TeeChart sources.

Re: Margins for Annotation

Posted: Fri Oct 23, 2009 8:11 am
by 10545590
Hi Yeray,
I only wanted to clarify that there is a way
Ok. Thx
while it's not included in TeeChart sources
Could you imagine when it will be included? I think it´s not such a hugh change in the sources.
But many other tools (like rectangle) will profit from that.

Re: Margins for Annotation

Posted: Fri Oct 23, 2009 8:56 am
by narcis
Hi moelski,
Could you imagine when it will be included?


Sorry but we are not able to provide an estimate date for now. However, I'm pretty sure that if it's implemented it won't be in v8 but in next major release. Please be aware at this forum or subscribe to our RSS news feed for new release announcements and what's implemented on them.
I think it´s not such a hugh change in the sources.
But many other tools (like rectangle) will profit from that.
Probably not but this is quite a specific need which anybody else requested so far. You must understand we have to give feature requests a priority level considering the general interests of TeeChart users among other criterion. Being a source code customer also gives you the option to customize sources to fit your exact needs.