Page 1 of 1

Custom marks loose background rect

Posted: Wed Jun 28, 2006 10:14 am
by 9339415
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;

Posted: Wed Jun 28, 2006 4:05 pm
by 9339415
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.

About marks rectangle again....

Posted: Sat Jul 08, 2006 3:59 pm
by 9335741
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?
:?:

Posted: Tue Jul 18, 2006 11:22 am
by Pep
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;