Home > Ax Technical > Creating graphs in Dynamics Ax

Creating graphs in Dynamics Ax

 
Creating a Graph with Dynamics Ax is quite easy. This article will deal on creating a simple graph.
The Graphics class in Ax helps out in creating graphs.
 
To Start with on using this class we shall creat a simple form ,
     1. Add a activex control of type ChartObject to the  Form
     2. You can either directly use the graphics class to display the data 
         when there is no user interaction.
     3. Now creat a method called createGraph in your form
         > In this method let us attempt to show all the Total accounts against their balance provided their
            balance value is greater than zero. The code would be something like this
  
           LedgerTable ledgerTable;
           #chartFx
           ;
 
           //GraphicsWindow – Activex control name 
           graphics = Graphics::newGraphicsTitlesLayout(GraphicsWindow, 100, 200,
                                            ‘Title’, ‘X’, ‘Y’, ‘z’,#CT_TOOL ,1,  1, 1);
          graphics.create();
          graphics.parmTitleXAxis(‘AccountNum’);
          graphics.parmTitleYAxis(‘Balance’);
          graphics.parmHeight(150);
          graphics.parmWidth(300);
          while select AccountNum from ledgerTable where ledgerTable.AccountPlType == LedgerAccountType::sum
          {
             if (ledgerTable.balance() > 0)
            {
                graphics.loadData(ledgerTable.AccountNum, ”, ledgerTable.balance());
            }
          }
          graphics.showGraph();
     
       4. Call this method on the init method of your form

       5. Now Just compile save and run, you should get a graph like the one below ….. so simple right 🙂
  
                              
          
  
         on the next post let us see about extending and using the graphics class
 
…………….  mmm how about making salary graphs !!!!!
Advertisements
  1. Tom
    April 20, 2007 at 8:11 pm

    When I try to run this chart, I get a license error for ChartFx.. Any Ideas?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: