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 11:06PM
    Hallo everyone,
    I need the same line of code.
    Can somebody post it ?

    Thank you,
    Carlo.
  • edited 11:06PM
    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

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.