Page 1 of 1

TLegendScrollBar problems

Posted: Fri Aug 26, 2005 8:47 am
by 9341341
Hi again.

I'm having problems adding the TLegendScrollBar at runtime.

Creation:
Self.FLegendScrollBar := TLegendScrollBar.Create(self);
Self.FLegendScrollBar.ParentChart := self;
Self.Tools.Add(Self.FLegendScrollBar);

Segfaults when the legend becomes visible (when I insert the first line) in:

procedure TLegendScrollBar.LegendCalcSize(Sender:TCustomChartLegend; var ASize:Integer);
begin
if Active and ShouldDraw(R) then // SegFault
Inc(ASize,Size+1);
end;

R = (-14680065, -14680065, -14680065, -14680065, (-14680065, -14680065), (-14680065, -14680065))

Anyone here that have had simililar problems or know how to fix this?

Regards
Frode

Posted: Fri Aug 26, 2005 9:04 am
by narcis
Hi Frode,

It works fine here using code below and latest TeeChart version available. Does this code works for you? Could you please modify it so that or send an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  LegendScroll: TLegendScrollBar;
begin
  LegendScroll:=TLegendScrollBar.Create(self);
  LegendScroll.ParentChart:=Chart1;

  Series1.FillSampleValues(50);
end;