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;
Help - TChartShape AV
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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:
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rick,
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.
You're welcome. Yes, I have already added this bug to our defect list to be fixed for future releases.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?
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 |
Instructions - How to post in this forum |