Jump to content

Creating a bar chart. For the data label on top of the bar ...


Todd Van Valkenburg

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...