[SOLVED] Graph: Format Data Values with Dollar Amounts
Hello,
I am displaying a graph with the sum of amounts plotted on the Y axis.
On the Properties tab under Y-Axis, I have Value Format: $10,000. This shows the summed amount on the Y-axis correctly. However, I'm unable to format the data values.
I went to Properties --> Settings --> Graph Settings and checked the box that says "Show Data Values" - which displays the total amount above the bar, but rather than "$100,000" it shows "100,000" (same as when hovering over the data). I want it to be consistent and show "$100,000".
Please assist. My code is below:
ENGINE SQLORA SET DEFAULT_CONNECTION ODSP
SQL SQLORA PREPARE SQLOUT FOR
select fy,
manager,
sum(case when future_ask = 'Y' then amount end) future_ask,
sum(case when pending = 'Y' then amount end) pending,
sum(case when past_due = 'Y' then amount end) past_due
from prop_pipeline
where fy >= table.get_FY_function
group by fy, manager
order by fy
END
GRAPH FILE SQLOUT
SUM COMPUTE PAST_DUE_AMOUNT/D20CN=PAST_DUE; AS 'Past Due' COMPUTE FUTURE_ASK_AMOUNT/D20CN=FUTURE_ASK; AS 'Future Ask' COMPUTE PENDING_AMOUNT/D20CN=PENDING; AS 'Pending'
ACROSS FY
WHERE MANAGER EQ &MANAGER.(OR(FIND PROP_PIPELINE.PROP_PIPELINE.MANAGER,PROP_PIPELINE.PROP_PIPELINE.MANAGER IN prop_pipeline)).Select a Manager:.;
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,0);
setAxisAssignment(2,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),6);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),6);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextJustHoriz(getO1Label(),0);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),12);
setTextRotation(getO1Label(),2);
setTextWrap(getO1Label(),false);
setPlaceResize(getO1Title(),0);
setPlaceRotate(getO1Title(),0);
setPlaceAlign(getO1Title(),0);
setPlaceWordWrap(getO1Title(),0);
setPlaceResize(getO1Label(),0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setPlaceWordWrap(getO1Label(),0);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
$
TYPE=DATA,
ACROSSCOLUMN=N1,
COLOR='RED',
FOCEXEC=app/pipeline_past_due_detail_1.fex( \
MANAGER=&MANAGER.QUOTEDSTRING \
),
$
TYPE=DATA,
ACROSSCOLUMN=N2,
COLOR='LIME',
FOCEXEC=app/pipeline_future_ask_detail_1.fex( \
MANAGER=&MANAGER.QUOTEDSTRING \
),
$
TYPE=DATA,
ACROSSCOLUMN=N3,
COLOR='YELLOW',
FOCEXEC=app/pipeline_detail_1.fex( \
MANAGER=&MANAGER.QUOTEDSTRING \
),
$
ENDSTYLE
END
This message has been edited. Last edited by: a415,
8009 Windows 7 Excel/HTML/AHTML/PDF
December 09, 2014, 11:32 AM
<nick z>
Hi, You can add:
setTextFormatPreset(getDataText(),6);
in order to format Data Labels.
As for the tooltip, You can try adding:
setUserToolTip ('[SL] for [GL] is $[YV]' );
But this may not work if you are on the older WebFOCUS release. Thanks. Nick.
December 09, 2014, 02:02 PM
a415
Hi Nick Z,
Thank you for your assistance.
I found that:
setTextFormatPreset(getDataText(),6);
formats the data values in the bar graph with the dollar values and commas, so it displays $100,000 above the bar on the graph. Thanks!
When hovering over the data, the pop-up removes the commas that were originally there, so now displays 100000. I tried adding:
setUserToolTip ('[SL] for [GL] is $[YV]' );
but nothing changes and the hover still shows 100000 with no formatting at all (I'm on version 7.7.03).
Does anyone have any thoughts on the tooltip pop-up when hovering over each bar to display $100,000 instead of 100000?
Thanks, Aimee
8009 Windows 7 Excel/HTML/AHTML/PDF
December 09, 2014, 03:21 PM
<nick z>
In WF 7703 custom tooltip setting only worked in Graph Applet mode. You would have to change ON GRAPH SET GRAPHEDIT SERVER to ON GRAPH SET GRAPHEDIT OFF
And also(very important) remove ON GRAPH PCHOLD FORMAT PNG
But I do not recommend using Graph Applets...
Highly recommend upgrading to an 8x release.
Thanks. Nick.
December 09, 2014, 06:22 PM
a415
Hi Nick,
Thanks again for your help!
ON GRAPH SET GRAPHEDIT OFF didn't change anything and removing ON GRAPH PCHOLD FORMAT PNG gave me a java related error.
I tried to just turn off the tool tip since you helped me get the dollars display correctly on the graph, but that didn't work. I tried:
setToolTipMode(false);
We are planning to make the switch to WF8, so going to add that as part of my testing and just make the change then.
Thanks again for all of your help!
8009 Windows 7 Excel/HTML/AHTML/PDF
December 10, 2014, 09:30 AM
<nick z>
Hi Aimee, to turn off tooltip: setToolTipDisplay(false);
What errors were you getting when you tried to use applet? What browser are you using?