Focal Point
[CLOSED] Display Percent Sign in Chart within InfoAssist

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

February 19, 2019, 09:25 AM
Doug
[CLOSED] Display Percent Sign in Chart within InfoAssist
What's wrong with this? The numeric value of the percentages is correct. But, what I'm missing is the percent sign on the line chart. The percent sign is displayed properly when you hover over the value.

BTW: This needs to be accomplished within InfoAssist 8204.

-*COMPONENT=Define_car
DEFINE FILE baseapp/car
DF_Profit_Amount/D12M=CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST ;
DF_Profit_Percent/D6.2%=((CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST) / CAR.BODY.DEALER_COST ) * 100;
END
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 baseapp/car
-* Created by Info Assist for Graph
SUM CAR.BODY.RETAIL_COST
CAR.BODY.DEALER_COST
DF_Profit_Amount
DF_Profit_Percent/D6.1%
BY CAR.CARREC.MODEL
WHERE CAR.CARREC.MODEL LE '2002 2 DOOR AUTO';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
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); 
setPlace(true); 
setCurveFitEquationDisplay(false); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N4, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N5, BUCKET=y-axis(2), $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);
setSeriesType(3,2);
setDataTextPosition(1);
setDisplay(getDataText(3), true);
setTextFormatPreset(getY2Label(),2);
setDisplay(getLegendArea(),false);
setCustomDataText(getDataText(3), true);
setTextFormatPreset(getDataText(3), 0);
setTransparentBorderColor(getSeries(*), true);
setSeriesType(2,1);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"riserBevel": "cylinder",
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}

*END
ENDSTYLE
END

-RUN
It's gotta be something simple, right?

This message has been edited. Last edited by: FP Mod Chuck,


   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Most recent: 8204 Gen 48 in Test and Production.
   Currently Available. Please contact me.
February 19, 2019, 11:08 AM
BabakNYC
In InfoAssist, change your percent by removing the * 100. Then right click the label on the line chart and choose More Labels Options...

For the Format Labels pick Percent with two decimals.


WebFOCUS 8206, Unix, Windows
February 19, 2019, 12:50 PM
Doug
Babak,

I got that. But, the display is '0' on hover...

-*COMPONENT=Define_car
DEFINE FILE baseapp/car
DF_Profit_Amount/D12M=CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST;
DF_Profit_Percent/D6=(CAR.BODY.RETAIL_COST - CAR.BODY.DEALER_COST) / CAR.BODY.DEALER_COST;
END
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 baseapp/car
-* Created by Info Assist for Graph
SUM CAR.BODY.RETAIL_COST
CAR.BODY.DEALER_COST
DF_Profit_Amount
DF_Profit_Percent
BY CAR.CARREC.MODEL
WHERE CAR.CARREC.MODEL LE '2002 2 DOOR AUTO';
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/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N4, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N5, BUCKET=y-axis(2), $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);
setTransparentBorderColor(getSeries(*), true);
setDataTextPosition(1);
setCustomDataText(getDataText(3), true);
setTextFormatPreset(getDataText(3), 4);
setSeriesType(3,2);
setTextFormatPreset(getY2Label(),4);
setFontName(getDataText(3), "ARIAL BLACK");
setFontSizeAbsolute(getDataText(3), true);
setFontSizeInPoints(getDataText(3), 12);
setPlaceResize(getDataText(3), 0);
setDisplay(getDataText(3), true);
setPieFeelerTextDisplay(1);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"riserBevel": "cylinder",
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}

*END
ENDSTYLE
END

-RUN


February 19, 2019, 01:59 PM
MartinY
As you probably already have noticed, it display 0 because your define do not include any decimal
DF_Profit_Percent/D6

Having defined as
DF_Profit_Percent/D6.2

will show the value but as a decimal one and not as a percentage such as in the DataText.

Since the percentage value is calculate internally based on selected display format,
I think that to have it displayed in the same way within the hover tooltip (20.55%) you need to use the customized tooltip which I don't think it's possible using IA


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
February 19, 2019, 02:25 PM
Doug
The D6.2 does show the two decimal places. But as a decimal, not as the percent as seen in the label of the line chart as required. Frowner

... "which I don't think it's possible using IA" ... Frowner


February 19, 2019, 02:30 PM
David Sibert
Doug,

In the past I put the percent sign in the Label. So in this case DF_Profit_Percent %. This will over do it but it is an option. This makes it a little bit easier to explain to the different Business partners that are able to create objects to be used in their groups.


dksib
DC Tech Services Inc
WF 8.2.1M
February 19, 2019, 03:04 PM
Doug
So, it looks like it cannot be done from within IA, Right?
February 19, 2019, 03:06 PM
MartinY
quote:
Originally posted by David Sibert:

In the past I put the percent sign in the Label. So in this case DF_Profit_Percent %.

Could be a great option, but the issue is that it will display
DF_Profit_Percent % 0.20

When in reality it is (such as in the DataText)
DF_Profit_Percent % 20.55



WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
February 19, 2019, 07:22 PM
Doug
NFR or Hopes that it'll be in the 8205 Designer.

OR I'll tag this as a NFR as that may push it to ensure it gets


   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Most recent: 8204 Gen 48 in Test and Production.
   Currently Available. Please contact me.