Using Charts in fastscript

;) Hello AlexTZ.
We have tried to use inside fastscript a chart with one series.
No problem to create the chart.
No problem to create the series.
We failed when assigning the series to the chart.
So we see nothing.
The 'ParentChart' property as we use it in Delphi doesn't work.
We have seen that your TCustomChart has a different parent
than defined in the Chart.pas from David Berneda.
Can you give us a pascal-example?
That would be helpful.

Comments

  • edited 8:10PM
    Hallo everyone,
    I need the same line of code.
    Can somebody post it ?

    Thank you,
    Carlo.
  • edited 8:10PM
    Hi,
    I'm working on it. As solution modify fs_ichartrtti.pas as following:
    //    AddClass(TChart, 'TCustomChart'); // Original
    // Inizio Carlo
        With AddClass(TChart, 'TCustomChart') Do
        Begin
            AddMethod('procedure RemoveAllSeries', ChartCallMethod);
            AddMethod('procedure AddSeries(ASeries:TChartSeries)', ChartCallMethod);
            AddIndexProperty('Series','Integer','TChartSeries',ChartCallMethod);
        End;
    
    
    (...)
    
    function TFunctions.ChartCallMethod(Instance: TObject; ClassType: TClass; const MethodName: String; Caller: TfsMethodHelper): Variant; //Carlo
    begin
        Result := 0;
        // Gestione propriet?  di TChart
        if ClassType = TChart then
        begin
            If MethodName = 'SERIES.GET'
            Then Result:= Integer(TChart(Instance).Series[Caller.Params[0]])
            Else If MethodName = 'ADDSERIES'
            Then TChart(Instance).AddSeries(Pointer(Integer(Caller.Params[0])))
            Else If MethodName = 'REMOVEALLSERIES'
            Then TChart(Instance).RemoveAllSeries;
        end;
    end;
    

    I hope Fast Report people will include some other methods and properties in further release.... ;)

Leave a Comment