Help - Search - Members - Calendar
Full Version: Using Charts in fastscript
Fast Reports forum > Fast Reports Products > FastScript
wolfgang wieland
ohmy.gif 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.
GeppoDarkson
Hallo everyone,
I need the same line of code.
Can somebody post it ?

Thank you,
Carlo.
GeppoDarkson
Hi,
I'm working on it. As solution modify fs_ichartrtti.pas as following:

CODE

//    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.... unsure.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.