Focal Point
[SOLVED] Charts - Data Text - Formating

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

March 18, 2015, 12:36 PM
GavinL
[SOLVED] Charts - Data Text - Formating
When I build a report I can use /F7.2M on my money columns and it will display a "$" at the beginning of each data display. When I do the same on a graph, I only get the number without the "$". Can someone tell me how to add the "$" for a graph?

Example Report (Works with $ in the data):
TABLE FILE CAR
SUM		CAR.BODY.SALES/F10.2M
BY		CAR.COMP.CAR
WHERE CAR.BODY.SALES GT 0;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,$
ENDSTYLE
END


Example Graph (Doesn't have $ in the data):
GRAPH FILE CAR
SUM		CAR.BODY.SALES/F10.2M
BY		CAR.COMP.CAR
WHERE CAR.BODY.SALES GT 0;
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
*GRAPH_SCRIPT
setDisplay(getDataText(0), true);
*END
ENDSTYLE
END

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



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
March 18, 2015, 12:45 PM
Tony A
Hi Gavin,

Look at using "setTextFormatPattern(.....,mask);" where "mask" is one of a myriad of options - see link

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 18, 2015, 01:06 PM
GavinL
That seems to work for only X and Y Axis values, but not for the data text..

Iv'e done this and only the getY1Label() version works..
setTextFormatPattern(getDataText(0),"$##");
setTextFormatPattern(getY1Label(),"$##");




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
March 18, 2015, 01:14 PM
GavinL
I copied and pasted their full example, which isn't using setTextFormatPattern, but the following and it still didn't do it. I'm using 8.0.09, but that example there also didn't help.

Here

GRAPH FILE CAR
SUM		CAR.BODY.SALES/F10.2M
BY		CAR.COMP.CAR
WHERE CAR.BODY.SALES GT 0;
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
*GRAPH_SCRIPT
-*setCustomDataText(getSeries(0), true);
-*setDisplay(getDataText(0), true);
-*setTextFormatPattern(getDataText(0),"$##");
-*setTextFormatPattern(getY1Label(),"$##");
setDepthAngle (0);
setDepthRadius (0);
setGraphType (41);
setCustomDataText (getSeries (2), true);
setCustomDataText (getSeries (1), true);
setCustomDataText (getSeries (0), true);
setTextFormatPreset(getDataText (2), 5);
setTextFormatPreset(getDataText (1), 6);
setTextFormatPreset(getDataText (0), 5);
setDataTextDisplay (true);
setViewableSeries (3);
setFontName(getDataText(2), "Comic Sans MS");
setFontName(getDataText(0), "Garamond");
setFontSizeAbsolute(getDataText(1), true);
setFontSize(getDataText(1), 14);        
setTextJustHoriz(getDataText(1),1);
setShadowDisplay(getDataText(1), true);
*END
ENDSTYLE
END




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
March 18, 2015, 01:26 PM
GavinL
I got something working, so I'm closer, but now it changed 10B to $10,000,000,000, which I need to the B back, just wanted the $ on the front.

GRAPH FILE CAR
SUM		CAR.BODY.SALES/F10.2M
BY		CAR.COMP.CAR
WHERE CAR.BODY.SALES GT 0;
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
*GRAPH_SCRIPT
setDataTextDisplay(true);
setTextFormatPreset(getDataText(),-1);  
setTextFormatPattern(getDataText(),"$##");
setTextFormatPattern(getY1Label(),"$##");
*END
ENDSTYLE
END




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
March 18, 2015, 01:32 PM
GavinL
Solution:

setDataTextDisplay(true);
setTextFormatPreset(getDataText(), 8);

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



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server