Home RAP

Load TeeChart through RAP

edited February 2003 in RAP
Is is possible to load a standard TeeChart with data through RAP? I am not
referring to hooking up against data pipeline. I am referring to manually
loading a TeeChart with data. Any ideas?

Thanks.

SMP

Comments

  • edited February 2003
    > Is is possible to load a standard TeeChart with data through RAP?
    We solved this by extending RTTI:
    - Published a SQL-Query component to RAP. We use DOA, so we published
    TOracleQuery. This might not be necessary for you if you are not fetching
    the data from the database, or if you use the built in Data Pipelines for
    this.

    - Published some Teechart functionality to RAP. I think you only need a
    couple of pass through functions. Remember that you will also need to be
    able to clear the series (in case you preview first, then click print).
    This is what we use (See "Demos\0. RAP" to learn about pass-through
    functions):

    procedure TAddToSeriesFunction.ExecuteFunction(aParams: TraParamList);
    var
    AChart : TCustomChart;
    AValue : extended;
    ALabel : string;
    AColor,ASeries,AResult : Integer;
    begin
    GetParamValue(0, AChart);
    GetParamValue(1, ASeries);
    GetParamValue(2, AValue);
    GetParamValue(3, ALabel);
    GetParamValue(4, AColor);
    AResult := AChart.series[ASeries].Add(AValue,ALabel,AColor);
    SetParamValue(5,AResult);
    end;{ procedure, ExecuteFunction }

    class function TAddToSeriesFunction.GetSignature: string;
    begin
    Result := 'function AddToSeries(const AChart:TCustomChart;
    ASeries:integer; AValue:extended; ALabel:String; AColor:Integer):integer;';
    end;

    procedure TClearSeriesFunction.ExecuteFunction(aParams: TraParamList);
    var
    AChart : TCustomChart;
    ASeries : Integer;
    begin
    GetParamValue(0, AChart);
    GetParamValue(1, ASeries);
    AChart.series[ASeries].clear;
    SetParamValue(2, ASeries);
    end;{ procedure, ExecuteFunction }

    class function TClearSeriesFunction.GetSignature: string;
    begin
    Result := 'function ClearSeries(const AChart:TCustomChart;
    ASeries:integer):integer;';
    end;

    Paul Wiik,
    Lynx Technologies
  • edited February 2003
    Thank you.
This discussion has been closed.