Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Formating data lables on a bar chart(PDF)
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Formating data lables on a bar chart(PDF)
 Login/Join
 
Member
posted
I have created a barchart and used Millions as unit on Y axis. I want to display the data labels as $ X.XX ($ symbol and two digits after decimal point). have tried different possible options available in appstudio but couldn't get required format. Please help me.

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 16 | Location: columbus | Registered: August 01, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I've looked for this specific format but can't find one. You can either do the Millions Currency or 2 decimals. You might want to open a case with IB tech support to see if they have a suggestion and please post it here so we know.


WebFOCUS 8204, Unix, Windows
 
Posts: 1457 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Jarves,
have a look at the below code, hope this helps
i think setting the following API will help
setTextFormatPreset(getY1Label(),10);
 

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='4.21875';
-DEFAULTH &WF_STYLE_WIDTH='8.020833';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ggsales
-* Created by Info Assist for Graph
SUM GGSALES.SALES01.DOLLARS
BY GGSALES.SALES01.PRODUCT
ON GRAPH PCHOLD FORMAT PDF
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END

TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTextFormatPreset(getY1Label(),10);
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH

 


WF 7.1-8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 53 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Member
posted Hide Post
Hi Addy,

I have tried your suggestion and the dollar symbol is getting added on Y axis units but not on top of the bars.
I have tried below. The $ symbol is getting added to he data labels which are on top of the bars but the decimal points are more than two (e.g. $10.65242)
setTextFormatPreset(getDataText(),10);

If I use below, I'm able restrict the decimals points but not getting the $ symbol.
setTextFormatPattern(getDataText(),"#.##");
 
Posts: 16 | Location: columbus | Registered: August 01, 2018Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Jarves,
Sorry i just gave you the Y axis string and not the data label but you figured it out.
As BabakNYC said that there is no exact setting to what you are asking for and opening a case might help.
In the mean time i have written the below code as a work around hope it helps.

 ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='4.21875';
-DEFAULTH &WF_STYLE_WIDTH='8.020833';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ggsales
-* Created by Info Assist for Graph
SUM COMPUTE DOLLAR_M/D12.2= GGSALES.SALES01.DOLLARS /1000000;
BY GGSALES.SALES01.PRODUCT
ON GRAPH PCHOLD FORMAT PDF
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 GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getDataText(0), true);
setDataTextDisplay(true);
setTextFormatPreset(getDataText(),-1);
setTextFormatPattern(getDataText(),"$ #.## M");
setTextFormatPreset(getY1Label(),6);
*END
ENDSTYLE
END
 


WF 7.1-8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 53 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Member
posted Hide Post
Hi Addy,

Thanks for the update.

The data labels are showing wrong values. instead of $20.23 M, It is getting displayed as $202345.81 M. Since I have used Millions as unit on Y-axis, the data labels are wrong. I tried to correct it but not succeeded yet.

Thanks,
Satish Narina
 
Posts: 16 | Location: columbus | Registered: August 01, 2018Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Jarves,
In the above example you can see that I have created a Compute column which brings the $ value to Millions with 2 decimals.

Then I am using the pattern to set the data lables.
As I said it is a work around.

Thanks


WF 7.1-8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 53 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Member
posted Hide Post
Thanks Addy.

The computed column works.


Thanks,
Jarves
 
Posts: 16 | Location: columbus | Registered: August 01, 2018Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Formating data lables on a bar chart(PDF)

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.