How can I set up axis limits by code?

edited May 2023 in FastReport VCL

Hello,

I have a report which has a graph on it and I need to set up its axis limits by code.

I have not succeeded on getting access to the chart component of the report which has been placed on a report band.

How can I do that?

Thank you very much.

Jayme Jeffman.

Comments

  • edited May 2023

    Thanks to the FastReport support I could solve my question:

    void __fastcall TFControlaInterrup::BMGReportPreview(TObject *Sender)

    {

       TfrxComponent *AComponent;

       TfrxChartView *ChrtView;


       AComponent = BMGReport->FindObject("Chart1");

       if( !AComponent ) ShowMessage("Componente Chart1 não encontrado");

       else{

          ChrtView = dynamic_cast<TfrxChartView*>(AComponent);

          if( ChrtView != NULL ){

             ChrtView->Chart->LeftAxis->Maximum = 4.0;

          }

       }


    Now I am able to chanhe Maximum and Minimum scale values on the axis.

    Kind regards



    }

Leave a Comment