Joanne Quan 2 Posted February 10, 2021 Share Posted February 10, 2021 Try this: setTextFormatPattern(getDataText(),"#.##"); Link to comment Share on other sites More sharing options...
David Beagan Posted February 10, 2021 Share Posted February 10, 2021 I looks like you can do this in InfoAssist as well: image.png907451 84.5 KB image.png1011878 60.9 KB Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 10, 2021 Author Share Posted February 10, 2021 This worked on the sample CAR graph above. Then I tried it on my actual graph and it did not work. Come to find out, I was using a stacked bar chart. So I found the same technique this in the Technical Library which worked: setTextFormatPattern(getDataTextStackedTotalOnTop()(),"#.##"); Thank you! Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 10, 2021 Author Share Posted February 10, 2021 Creating a bar chart. For the data label on top of the bar chart, the user would like to always display 2 digits to the right of the decimal point. So instead of 8.9 the user would like to see 8.90. I tried floating point, decimal, packed with 2 decimal places but did not help. Must be a numeric field since on the vertical axis. Example code below using CAR. So England display 22.2 instead of 22.20. image.png825720 15.5 KB ENGINE INT CACHE SET ON SET PAGE-NUM=NOLEAD -DEFAULTH &WF_HTMLENCODE=OFF; SET HTMLENCODE=&WF_HTMLENCODE SET ARGRAPHENGINE=JSCHART -DEFAULTH &WF_EMPTYREPORT=ON; SET EMPTYREPORT=&WF_EMPTYREPORT SET EMBEDHEADING=ON SET GRAPHDEFAULT=OFF -DEFAULTH &WF_STYLE_UNITS='PIXELS'; -DEFAULTH &WF_STYLE_HEIGHT='405.0'; -DEFAULTH &WF_STYLE_WIDTH='770.0'; -DEFAULTH &WF_TITLE='WebFOCUS Report'; GRAPH FILE ibisamp/car -* Created by Info Assist for Graph SUM PCT.CNT.CAR.SPECS.LENGTH/D12.2 BY CAR.ORIGIN.COUNTRY ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET VZERO OFF ON GRAPH SET GRWIDTH 1 ON GRAPH SET UNITS &WF_STYLE_UNITS ON GRAPH SET HAXIS &WF_STYLE_WIDTH ON GRAPH SET VAXIS &WF_STYLE_HEIGHT ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET AUTOFIT ON ON GRAPH SET STYLE * *GRAPH_SCRIPT setPieDepth(0); setPieTilt(0); setDepthRadius(0); setCurveFitEquationDisplay(false); setPlace(true); *END INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$ TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $ TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $ TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $ *GRAPH_SCRIPT setReportParsingErrors(false); setSelectionEnableMove(false); setDataTextPosition(1); setDisplay(getDataText(),true); setDataTextDisplay(true); *END ENDSTYLE END -RUN Thank you for your help. Todd Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now