Help - TChartShape AV
Posted: 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;
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;