I would like to show the data in millions with only 2 decimal places.
For example, if my data shows 10,245,678 then want to show in the graph as 10.24M.
I tried using the setDataTextFormat(10) but it shows as 10.245678M.
see the sample code below,
DEFINE FILE CAR RCOST/D15.2=IF COUNTRY EQ 'ENGLAND' THEN 25456789 ELSE 43780945; END
GRAPH FILE CAR SUM RCOST BY COUNTRY ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET 3D OFF ON GRAPH SET GRAPHDEFAULT OFF ON GRAPH SET VZERO OFF ON GRAPH SET HAXIS 500 ON GRAPH SET VAXIS 400 ON GRAPH SET UNITS PIXELS ON GRAPH SET LOOKGRAPH HBAR ON GRAPH SET GRAPHSTYLE * setDisplay(getDataText(),true); setFontName(getDataText(),"Arial"); -*setTextFormatPattern(getDataText(0),"##.##");
setDataTextFormat(10); setDataTextFormatPattern("##.##"); ENDSTYLE END -EXIT
ThanksThis message has been edited. Last edited by: <Kathryn Henning>,
WFConsultant
WF 8105M on Win7/Tomcat
June 20, 2013, 02:13 PM
Doug
Unless I'm missing part of your question, all that's needed is to open it in Graph Assitant, select Properties, select Y Axis, select desired Value Format.
June 20, 2013, 02:27 PM
Kamesh
Doug,
I did that. That will put you the code setDataTextFormat(10) but it is not solving my purpose.
WFConsultant
WF 8105M on Win7/Tomcat
June 20, 2013, 05:53 PM
Waz
You need to use a custom format for the number.
Search Focalpoint and the documentation for setDataTextFormatPattern
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
June 21, 2013, 08:45 AM
Kamesh
waz,
see my sample code. I already have that API.
Yes I did looked in FocalPoint and documentation before posting something here.
WFConsultant
WF 8105M on Win7/Tomcat
June 23, 2013, 06:01 PM
Waz
Kamesh, take a close look at this link, and the setting for setDataTextFormat.