mrc Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/

 

 

Creating Line Graphs with a Static Goal Line

 

Often times when creating a Line Graph, you will have a need to create a “Goal” Line (or Reference Line) that will serve as a constant horizontal line to track if you have met a certain goal. Setting this up with a Web 2.0 Report with Graph is very straightforward. In the following example, I am going to print a set of users Credit Limit, and compare that with a static “Target” goal.

 

Below, you can see I plan on graphing the Credit Limit Field (CRLIM).

 

However, I need to create a target goal, this can be done with a calculation. I will set my $6500.

As you can see, I have simply set a calculation equal to 6500.

 

After I build my application, I must go into m-Painter. The first thing I will do is remove the calculation column. Since this will only be used in the graph logic, it does not need to be present in my output table. Simply right click on the column, and select “Delete Column.”

 

Next, I will need to modify the Graph Properties. To do this, right click on the Graph, and select “Graph Properties.” Select the “Image Data Collection Tab.”

 

The first that we will need to do is select the Line Chart option from the “Image Style” dropdown box.

 

Next, in the Graph Values section, I can see that we are going to print the Credit Limit and the Calculation, however we need to print them from the Detail Row, not the Grand Total Row. This is needed because we need to have data for each individual customer, not just the grand total. To change this, please click the “Apply All” button in the top right

 

This will change the text inside the Graph Values boxes to now reference the Detail Row.

 

Lastly on this screen, we must specify a “Graph Value in Groups” field. This will allow us the opportunity to group by specific, in this case, customer number. Simply, type in the text, ${row.CUSNO}, where CUSNO is the name of your sequence field. When completed, your screen should resemble this,

 

Before, we finish, we need to make two more slight changes. First, click the “Image Properties” tab. Scroll down approximately ¼ of the way down, and set the x_showitemvalue to “No.”

 

This change will clean up the graph quite a bit, as it will not try to write the value for each customer on the line, making the graph illegible.

 

Click OK.

Lastly, move the Image Data Collection Icon, by dragging and dropping, from the Grand Total row up to the Detail row. Since we selected to graph from the detail row, we also must move the image data collection.

Before:

 

After:

 

Click the “Save and Deploy” button, and run your application.

 

Your output should look something like this.