AddProperty ParentChart error

Hi,
I've tried to modify fs_ichartrtti.pas to add ParentChart property to a TCustomSeries:
constructor TFunctions.Create(AScript: TfsScript);
begin
  inherited Create(AScript);
  with AScript do
  begin
(...)

    With AddClass(TCustomSeries, 'TChartSeries') Do
    Begin
        AddProperty('ParentChart','TCustomAxisPanel',GetProp,SetProp);
// even this will not work     AddProperty('ParentChart','TChart',GetProp,SetProp);
    End;

(...)

function TFunctions.GetProp(Instance: TObject; ClassType: TClass; const PropName: String): Variant;
begin
    Result := 0;
    if PropName = 'PARENTCHART'
    then Result := Integer(TCustomSeries(Instance).ParentChart);
end;

{ property handler }
procedure TFunctions.SetProp(Instance: TObject; ClassType: TClass; const PropName: String; Value: Variant);
begin
    if PropName = 'PARENTCHART'
    then TChartSeries(Instance).ParentChart:=TChart(Integer(Value));
//    then TChartSeries(Instance).ParentChart:=TCustomAxisPanel(Integer(Value));
//    then TCustomSeries(Instance).ParentChart:=TCustomChart(Integer(Value));
end;

None of this solutions works: when i compile a fsScript containing Series1.ParentChart it gives the error:
Incompatible types: 'Class TCustomAxisPanel', 'Class:TChart'

How should I do?

Thank you,
Geppo Darkson.


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.