Custom marks loose background rect

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
mtspp
Newbie
Newbie
Posts: 12
Joined: Mon Oct 04, 2004 4:00 am

Custom marks loose background rect

Post by mtspp » Wed Jun 28, 2006 10:14 am

When Series marks are positioned they loose some of their capabilities.
I can cange the fonts color and size, but the surrounding rectangle is gone. No matter if I try it for the whole series or for a individual mark, I never see more than the pure text.

APosition := TSeriesMarkPosition.Create;
APosition.Custom := false;
APosition.LeftTop.X := Series1.Marks.Positions.LeftTop.X;
APosition.LeftTop.Y := 50;
Series1.Marks.Positions := APosition;
with Series1.Marks do begin
Font.Size:=12; // works
Font.Color:=clRed; // works
Color:=clNavy; // dows not work
end;

mtspp
Newbie
Newbie
Posts: 12
Joined: Mon Oct 04, 2004 4:00 am

Post by mtspp » Wed Jun 28, 2006 4:05 pm

I finally found the problem by myself :
I took pieces of sourcecode from Steema, they always set just just the position itself.
But the position contains more parameters that MUST be set to work, these are at least the height and width parameter.
Looking back it seems quite logical.

Neiither the examples nor the help tells anything about this.
I understand that it is not always possible to avoid misleading words like position. But the help should be more helpful in this case.

AKazak
Newbie
Newbie
Posts: 1
Joined: Tue Feb 03, 2004 5:00 am

About marks rectangle again....

Post by AKazak » Sat Jul 08, 2006 3:59 pm

Hi!

I have a same problem that you had, when white rectangle of Arrow marks doesn't display at screen at all...

Could you write please in detail, how did you fix it?

Does anyone have the problem of this kind?
:?:

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jul 18, 2006 11:22 am

Hi,

if you customize any Mark you must set the width and height of the mark :

Code: Select all

procedure TForm1.BitBtn1Click(Sender: TObject);
var APosition: TSeriesMarkPosition;
begin
APosition := TSeriesMarkPosition.Create;
APosition.Custom := false;
APosition.LeftTop.X := Series1.Marks.Positions[0].LeftTop.X;
APosition.LeftTop.Y := 50;

APosition.Width:=12+Chart1.Canvas.Textwidth(floattostr(series1.YValue[0]))+12;
APosition.Height:=20;

Series1.Marks.Positions[0] := APosition;
with Series1.Marks[0] do begin
Font.Size:=12; // works
Font.Color:=clRed; // works
Color:=clNavy; // dows not work
end;

end;

Post Reply