Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Cell - based Graphics, Bullet Graph question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Cell - based Graphics, Bullet Graph question
 Login/Join
 
Master
posted
During Summit, I went to the cell-based graphics presentation and found the 'bullet' graph to be something we'd really like to use here.

I've gone through the summit CD sent to me and I can find the .ppt for this, but it simply points to a 'bullet.mas' file with some very cryptic field names. Without the source data, I'm having trouble figuring out how to create this graph.

Is there any other information available for creating these bullet graphs, such as an online how-to? When I search IBI's site nothing of value shows up for "bullet graph".

Any help would be appreciated.

Thank You!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
Did you try looking in the new Advanced Graph Assistant?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
At Summit, Dan used a lot of new features in 7.6 that lets you build these things a lot easier, but here is an example of how these were done in 5.x and 7.1
-* Bullet
 
-DEFAULT &QST_DT  = '19970401'
-DEFAULT &QED_DT  = '19970630'
-DEFAULT &CURR_DT = '19970531'
-DEFAULT &MEASURE = 'DOLLARS'
-DEFAULT &TARGET  = 'BUDDOLLARS'
-DEFAULT &OUTPUT  = 'qtd_dollars_w_target_good_sat_bad'
 
FILEDEF MG   DISK dashboardgraphics/mg.mas
 
APP APPENDPATH IBISAMP
 
DEFINE FILE GGSALES
  D_YY/YY = DATE;
  D_MTH/M = DATE;
  D_YYM/YYM = DATE;
END
 
-* Assumptions:
-*   Bad  = 75% or less of target.
-*   Sat  = 76% to 105% of target.
-*   Good = 106% + of target.
-* Graph upto 110% of highest value.
TABLE FILE GGSALES
SUM COMPUTE BLANK/A1 = ' ';
    COMPUTE ACT_TARGET/D12  = IF DATE GE '&QST_DT' AND DATE LE '&QED_DT'  THEN &TARGET  ELSE 0; AS 'TARGET'
    COMPUTE ACT_DOLLARS/D12 = IF DATE GE '&QST_DT' AND DATE LE '&CURR_DT' THEN &MEASURE ELSE 0; AS 'ACTUALS'
    COMPUTE MAXVALUES/D12   = MAX(ACT_DOLLARS * 1.10, ACT_TARGET * 1.10);
WHERE DATE GE '&QST_DT' AND DATE LE '&QED_DT';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS TMPDATA FORMAT ALPHA
END
-RUN
 
JOIN BLANK IN TMPDATA TO BLANK IN MG AS J1.
 
-* For line 1 and 3, we need to show the bsg numbers as they should.
TABLE FILE TMPDATA
PRINT TARGET
     COMPUTE C_ACTUALS/D12  = IF COUNTER EQ 2 THEN ACTUALS  ELSE 0; AS 'ACTUALS'
  COMPUTE C_BAD/D12      = IF COUNTER NE 2 THEN (TARGET *  .75)
                              ELSE IF ACTUALS LT (TARGET * .75) THEN (TARGET * .75) - ACTUALS
              ELSE 0; AS 'BAD'
  COMPUTE C_SAT/D12      = IF COUNTER NE 2 THEN (TARGET * 1.05) - C_BAD
                              ELSE IF ACTUALS LT (TARGET * 1.05) THEN (TARGET * 1.05) - ACTUALS - C_BAD
                                   ELSE 0; AS 'SAT'
  COMPUTE C_GOO/D12      = IF COUNTER NE 2 THEN (MAXVALUES) - C_SAT - C_BAD
                              ELSE IF ACTUALS LT ((MAXVALUES) - C_SAT - C_BAD) THEN ((MAXVALUES) - C_SAT - C_BAD) - ACTUALS
                                   ELSE 0; AS 'GOOD'
BY COUNTER
WHERE COUNTER LE 3
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS TMPGRPH FORMAT ALPHA
END
 
GRAPH FILE TMPGRPH
SUM TARGET ACTUALS BAD SAT GOOD
BY COUNTER
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
-* turn off 3d option.
ON GRAPH SET 3D OFF
-* remove plotting of zero values.
ON GRAPH SET VZERO OFF
-* turn off the default grid settings.
ON GRAPH SET GRID OFF
-* set absolute height to 17 px.
ON GRAPH SET VAXIS 17
-* set absolute width to 150 px.
ON GRAPH SET HAXIS 210
-* ON GRAPH HOLD AS TOUT FORMAT PNG
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setGraphType(25);                      // Set graph to Horizontal Stacked
setDepthRadius(0);                     // Turn off 2.5D
setDepthAngle(0);                      // Turn off 2.5D
setFillColor(getChartBackground(), new Color(255 255 255)); // chart border stuff
 
setO1AxisSide(0);
setY1AxisSide(2);
setMarkerDisplay(false);
setConnectLineMarkers(true);
-* setConnectScatterMarkers(false);
 
-* line (target) points
setAxisAssignment(0,0);
setSeriesType(0,2);
setFillColor(getSeries(0), new Color(0 0 0));
setLineWidth(getSeries(0), 2);
setMarkerSize(getSeries(0), 0);
 
-* stack bar points
setAxisAssignment(1,0);
setSeriesType(1,1);
setFillColor(getSeries(1), new Color(0 0 0));
setAxisAssignment(2,0);
setSeriesType(2,1);
setFillColor(getSeries(2), new Color(150 150 150));
setAxisAssignment(3,0);
setSeriesType(3,1);
setFillColor(getSeries(3), new Color(190 190 190));
setAxisAssignment(4,0);
setSeriesType(4,1);
setFillColor(getSeries(4), new Color(225 225 225));
 
setO1TitleDisplay(false);
setO1LabelDisplay(false);              // Turn off Ordinal (Category) Axis Labels
setO1MajorGridDisplay(false);          // Turn off Ordinal (Category) Axis Major Grid lines
setO1AxisLineDisplay(false);           // Turn off Ordinal (Category) Axis display
 
setY1LabelDisplay(false);              // Turn off Numeric Axis Labels
setY1AxisLineDisplay(false);           // Turn off Numeric Axis display
setY1MajorGridDisplay(false);          // Turn off Numeric Axis Major Grid lines
setY1MajorGridStepAuto(false);
setY1MinorGridDisplay(false);
 
setExtendToFrameEdge(true);            // Extend graph to use entire presentation area.
 
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
 
setFootnoteDisplay(false);
setSubtitleDisplay(false);
setTitleDisplay(false);
setToolTipDisplay(false);              // Turn off tool tips
setFrameDisplay(false);                // Turn off graph frame display
setLegendDisplay(false);               // Turn off legend
setLegendAutomatic(false);
 
setRiserWidth(100);
 
setRect(getFrame(), new Rectangle(-16000,-16000,32000,32000));
setPlace(true);
ENDSTYLE
END


The mg.mas
  
  FILE=FSEQ,SUFFIX=FIX,REMARKS='McGuyver Technique'
SEGNAME=SEG1
FIELD=BLANK,,A1,A1,$
SEGNAME=SEG2,OCCURS=80,PARENT=SEG1
FIELD=CHAR1,,A1,A1,$
FIELD=COUNTER,ORDER,I4,I4,$


Hope this helps.

If you have Dan's presentation, then you can change the above to support Dan's enhancements.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
Thanks for the help dhagen!
I think I've got the logic figured out, using a stacked bar graph as the presenter at summit did, but I'm a little confused on how to make the black line (the bullet) and the target.

In the powerpoint, it's simply not addressed or I've completely missed it.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
You might be just missing it a bit. Below is the output of the TMPGRPH file:
  
 COUNTER      TARGET     ACTUALS         BAD         SAT        GOOD
 -------      ------     -------         ---         ---        ----
       1   5,782,885           0   4,337,164   1,734,866     289,145
       2   5,782,885   5,661,962           0     410,067     289,145
       3   5,782,885           0   4,337,164   1,734,866     289,145


The target is actually plotted as a line. The rest are just bars. The essential point here is that in the second group of stack bars, you reduce or zero out the values of bad, sat, and good to allow the actuals to be plotted properly, and have all the stacks finish at the same end point.

So, just to clarify:
COUNTER = stack bar grouping.
TARGET = plotted as black line.
ACTUALS = plotted as black bar. (suppress zero)
BAD = plotted as dark grey bar.
SAT = plotted as medium grey bar.
GOOD = plotted as light grey bar.

Hope this clears it up.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
This is Great information dhagen!
I've done this with my data, and it looks great, except that the black bar for the Actual sales seems to the same width as the other bars.

Is there any way to make the Actual (black) bar a little thinner than the other bars?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
Nope!

Remember, you are trying to convey a message here. Dan's presentation was based on not just bullet graphs, but on cognitive perception as well. Symmetry is important. You don't want to challenge a user's ability to interpret the message, rather, you want them to interpret the message - or messages when it comes to a bullet graph - as quickly as possible.

That being said, if you expand the bullet to 5 lines and plot the actuals on the 3rd line, then you would accomplish what you want.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
now that I'm actually running my fex, I'm really confused.

How do I get the graphs to overlap each other? As in, how do I make this 'macgyver' technique happen? It's mentioned, but not explained.

Thanks again!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
I'm sorry, but I do not know what you mean by "overlap each other".

The macgyver technique is used only to take 1 row of data, and replicate it X times. For example, the actual data that is used in this graph is only one row. However, we need at least 3 rows to produce the desired result. The macgyver technique is used to turn that 1 row into 3 by using the multiplicative effect. It is not as important to understand how it works as much as what it is doing. The "BY COUNTER WHERE COUNTER LE 3" is the critical line here.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
From what I understand of how these bullet graphs work, what I'm doing is creating a stacked bar graph (for the three shades of grey 'good','ok' and 'bad') and adding another number to it, visualized as a line, as the target number.

What I don't get is how to stack the actual sales into this stacked bar graph that has line graph data 'visualized' over the top.

Thank you for your patience.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
Jason,

I've had to explain this to a lot of people over the last couple of years - including Dan, and I have obviously not mastered the proper explanation. Rest assured, when the light finally comes on, it will shine brightly forever.

In a stacked bar graph, the stacked order is determined by the order of the verb objects. Hence the first bar is Actuals, then Bad, Sat, and Good. The size of the stack is determined by the values of the measures. For example, if the values are A=10, B=5, S=3, and G=2, then the total stack will be 20. The A is plotted from 0-10, B is plotted from 11-15, S is plotted from 16-18, and G is plotted from 19-20. If the values are A=0, B=15, S=3, and G=2: The A is plotted as 0, B is plotted from 1-15, S is plotted from 16-18, and G is plotted from 19-20.

Over the three lines, G S and B are the same values, and Actuals are always plotted as zero. This changes for the line that the actuals are being displayed. The values of G S and B must be changed to account for the actual value.

So,
For B: if A > B, then we need to calculate B = 0. This will prevent B from being plotted. If A < B, then the value of B would be the difference of B-A.
For S: if A > B+S, then we would need to zero out S as well. If A < B, then the value for S would not change. If however A > B but A < B+S, then we need to change the value of S to be the difference of B+S-A. We do this because we need S to end at exactly the same place in all lines of the bullet.
For G: if A > B+S, then we would need to plot G as the difference of B+S+G-A. Otherwise, G should be left unchanged.

Note: G will never be zero, because, the end value for G should always be calculated greater then the largest value of either A or G. I usually use 5 or 10% then the largest absolute highest value to be plotted.

You are welcome to forward me your code (and maybe some sample data) and I can take a look. Do you still have my email?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
Good writeup dhagen! It seems a little simpler now!

Which of the variables listed covers the 'target' for the bullet? as in, that vertical line in the power points?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
I did not cover the target. The target is always the first verb object, and it must be the same for all stacks. The target is plotted as a line. It is necessary to plot as a line so that it will be visible and distinct in the graph. If you try to plot as just a single point, then it would be reduced to a small point that would be effectively invisible in a graph this small. There is no calculations for the line, as it is the same value for each grouping (counter).

Hope that helps


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
I think it's clear as a bell now!
The powerpoint is for ONE item, so you have the same value for the target each time.

So, if a fella wanted to do more than one area he would have to write up a for next loop or something and show each graph as a seperate image rather than mapping a few bars on the same graph?

Thanks again for your patience dhagen. If it weren't for your help I probably would have just given up.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Jason K.:
So, if a fella wanted to do more than one area he would have to write up a for next loop or something and show each graph as a seperate image rather than mapping a few bars on the same graph?


Yep! My advise would be to run the graphs via a caster job overnight and save them to an images directory. You would then incorporate the images via a compute in your final report(s). Well, so long as what you are displaying does not require real-time data of for pure operational consumption. If you name your graphs logically (iow: tie them into field values) then you can write is like as follows:

COMPUTE BULLET/A100 = '<img src="/approot/myapp/images/act_kpi_bullet_' || some_field || '.png">';


This way you can have 1 or more bullets on every line in a report.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
Great!
Thanks for your help dhagen!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Cell - based Graphics, Bullet Graph question

Copyright © 1996-2020 Information Builders