Help - TChartShape AV

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Help - TChartShape AV

Post by RSpence » Wed Mar 16, 2005 9:22 pm

Hi,

I have a problem with a TShapeShape component. I reduced it to the following code - obviously the real code is more complex but this illustrates the point. I place a chart on the form at design time, but no series. I use the following code to create and initialize the series.

The clear, indiciated by the comment NB below, causes the subsequent assignment to x0 to fail. Without the clear it works fine. Obiously the clear is clearing something I need to re-establish...I know I can remove the clear - but as I said in the real app. it's a bit more complex.

Thanks in advance,

Regards,

Rick

var
uhActionLevelText : TChartShape;

begin

uhActionLevelText := TChartShape.Create( Self );
with uhActionLevelText do
begin
clear; // NB - this causes X0 assignment below to fail
ParentChart := self.Chart1;
Alignment := taLeftJustify;
Font.Color := clRed;
Font.Style := [fsBold];
Font.Size := 10;
Pen.Visible := False;
Transparent := True;

X0 := 100;
X1 := Chart1.BottomAxis.Maximum;
Y0 := Chart1.LeftAxis.Maximum / 2.0;
Y1 := Chart1.LeftAxis.Maximum;
Text.Text := '< AL = %-1.1n ppm';
end;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Mar 17, 2005 8:47 am

Hi Rick,

I've been able to reproduce your problem here. Replacing your clear line for Delete(0,Count); makes the AV disappear. Working code would be:

Code: Select all

var
  uhActionLevelText : TChartShape;
begin
  uhActionLevelText := TChartShape.Create( Self );
  with uhActionLevelText do
  begin
    //clear; // NB - this causes X0 assignment below to fail
    Delete(0,Count);
    ParentChart := self.Chart1;
    Alignment := taLeftJustify;
    Font.Color := clRed;
    Font.Style := [fsBold];
    Font.Size := 10;
    Pen.Visible := False;
    Transparent := True;

    X0 := 100;
    X1 := Chart1.BottomAxis.Maximum;
    Y0 := Chart1.LeftAxis.Maximum / 2.0;
    Y1 := Chart1.LeftAxis.Maximum;
    Text.Text := '< AL = %-1.1n ppm';
  end;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

Post by RSpence » Thu Mar 17, 2005 10:47 pm

Once again thanks - I guess you will log this for possible fix in a maintenance release - or do I need to do that?

Does the delete have the same effect as the clear?

Regards,

Rick

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 18, 2005 8:36 am

Hi Rick,
Once again thanks - I guess you will log this for possible fix in a maintenance release - or do I need to do that?
You're welcome. Yes, I have already added this bug to our defect list to be fixed for future releases.
Does the delete have the same effect as the clear?


According to TeeChart help definitions:

Clear: This method deletes all Series values. Dependent Series are notified. If no new points are appended to the Series, nothing will be painted.

Delete: The Delete method will remove the # ValueIndex point from the Series values lists. The ParentChart will be automatically redrawn. Dependent Series will be recalculated.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply