Focal Point
[SOLVED] Total on across label

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

June 12, 2012, 09:19 AM
pferreira
[SOLVED] Total on across label
Hi,

I'm kind of a noob in WF and i'm trying to create a graph report that is presented using a % stacked bar (VBRSTKPC)but I want to show the total value on each bar label.

Something like this:

GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST
CAR.BODY.SALES
CAR.BODY.RETAIL_COST
ACROSS CAR.ORIGIN.COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTKPC
ON GRAPH SET GRAPHSTYLE *
setDisplay(getDataTextStackedTotalOnTop(), true);
setFillColor(getDataTextStackedTotalOnTop(),new Color(0,0,255));
setDataTextPosition(0);
setTextRotation(getDataTextStackedTotalOnTop(), 0);
setO1LabelRotate(0);
setPlace(true);
END
-EXIT


SO, I want the real value on the labels (like 'FRANCE 100k')

Thanks in advance!

Pedro

This message has been edited. Last edited by: pferreira,


WF 8.0.02 @ Linux environment
June 12, 2012, 12:44 PM
susannah
edit your profile to say what version you are in.
No way using the tool, but there is a way using alot of custom code. you would first create an extract file with the country names and values, read them out into &variables, and then use the ANNOTATION feature in the tool, which basically puts strings of text anywhere you want them.
But since you're a newby, use the regular tool for a while, then come to Summit, and you'll be ready for advanced coolness.
also, LEGEND and LABEL are different concepts, so make sure you know which one you want. Since you say 'FRANCE....' , you're probably referring to LEGEND




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 12, 2012, 01:06 PM
pferreira
Well, first of all, it's weird that my signature doesn't show my full profile since it is complete with all information os sw versions, perhaps there is something that I have to enable.. i'll check it.

Anyway WF & WFDTools 7702.

I managed to find a way to do it (I almost never use the building tool), I just imagined that there might be a better way, but here it is:


-*#### SUM EVERYTHING
DEFINE FILE CAR
ALLSUM/D20 = CAR.BODY.DEALER_COST + CAR.BODY.SALES + CAR.BODY.RETAIL_COST;
END

-*#### CREATE LABELS
TABLE FILE CAR
SUM ALLSUM NOPRINT
COMPUTE XLABEL/A60 = CAR.ORIGIN.COUNTRY | '\n'|'$'| EDIT(FTOA(ALLSUM, '(D6)','A8'),'999$999$99');
BY CAR.ORIGIN.COUNTRY NOPRINT
-*ON TABLE PCHOLD FORMAT HTML
ON TABLE HOLD AS LABELS FORMAT COM
END
-RUN

GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST
CAR.BODY.SALES
CAR.BODY.RETAIL_COST
ACROSS CAR.ORIGIN.COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTKPC
ON GRAPH SET GRAPHSTYLE *
setLegendDisplay(true);
setLegendPosition(5);
setO1LabelRotate(0);
setFontSizeAbsolute(getO1Label(),true);
setPlace(true);
setO1LabelWrap(true);

-*#### SHOW LABELS
setGroupLabelArray(
-INCLUDE LABELS
);
END
-EXIT


Thanks anyway Wink
Pedro


WF 8.0.02 @ Linux environment
June 12, 2012, 01:42 PM
susannah
way to go, Pedro!
btw, use FPRINT instead of FTOA




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID