How can I set up axis limits by code?

edited May 6 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 8

    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

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.