Focal Point
[CLOSED] Conditional Image Next to Each Bar in Graph

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9587013296

January 10, 2020, 09:56 AM
Brandon Andrathy
[CLOSED] Conditional Image Next to Each Bar in Graph
Hey All,

I'm trying to think of a way to be able to put a traffic light next to a bar graph and wondering if there's a way to do it in FOCUS.

In the car file below, I'd like to place the "TREND" compute number next to each bar and make that a conditional image depending on whether the number is positive or negative.


GRAPH FILE CAR
SUM
	SALES
	COMPUTE TREND/D12 = (SALES - RETAIL_COST)/RETAIL_COST;
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
-*ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=HEADING, JUSTIFY=CENTER, FONT='ARIAL', STYLE=BOLD, SIZE=11, COLOR=RGB(75 75 75), $
TYPE=FOOTING, LINE=1, ITEM=1, COLOR=RGB(0 77 113),$
TYPE=FOOTING, LINE=1, ITEM=2, OBJECT=TEXT, FONT='ARIAL', SIZE=8, STYLE=NORMAL, $
*GRAPH_SCRIPT
setDataTextDisplay(true);
setDataTextPosition(4);
setDisplay(getDataText(0), true);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "seriesLayout": "stacked",
    "orientation": "horizontal"
},
"agnosticSettings": {
    "chartTypeFullName": "Bar_Stacked_Horizontal"
}
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH
 


Thanks in advance for your help and looking at this!!

This message has been edited. Last edited by: Brandon Andrathy,


WebFOCUS 8204
January 16, 2020, 11:06 AM
FP Mod Chuck
Brandon

Thought I answered this the other day but I guess not. You will have to use Traffic Light conditions on the Trend field when I tried to trick WF by creating a DEFINE of an image and reference that the graph would not open in the GUI again and did not display the image when running it from the text editor.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
January 16, 2020, 11:31 AM
Brandon Andrathy
Thanks Chuck, appreciate it! came up with another solution. This isn't typically a way for users to view data so went with another approach.


WebFOCUS 8204