Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Minus Sign Graph Data Text

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Minus Sign Graph Data Text
 Login/Join
 
Platinum Member
posted
I have a waterfall graph for which negative bars are coloured in red and positive bars in green. The user wants the data text displayed on the graph, but without the minus sign for the negative numbers.

I can get this to work in HTML format on screen, but as soon as I hold the graph the minus sign is back. (I've tried jpeg, png and svg). This is one of several graphs in a compound pdf.

Does anyone know how to get this to work?

Example Graph

  
TABLE FILE CAR
SUM
DEALER_COST 
RETAIL_COST 
COMPUTE MGN/D12.2=RETAIL_COST-DEALER_COST;
COMPUTE MKU/D12.2=(-0.25)*DEALER_COST;
COMPUTE COST/D12.2=DEALER_COST+MKU;
BY CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS TESTDATA FORMAT ALPHA
END
GRAPH FILE TESTDATA
SUM
MKU AS ''
BY CAR AS ''
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHSTYLE *
setFontSizeAbsolute(getDataText(),true);
setFontName(getDataText(),"Arial");
setCustomDataText(getDataText(0),false);
setDisplay(getDataText(),true);
setDataTextFormat(-1);
setDataTextFormatPattern("##;##");
setPlaceResize(getDataText(),0);
setFontSize(getDataText(),6);
setFontStyle(getDataText(),0);
setFillColor(getDataText(),new Color(0,0,0));
setPlacePosition(getDataText(),1);
ENDSTYLE
END

This message has been edited. Last edited by: Kerry,


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Expert
posted Hide Post
Try this format pattern.

setDataTextFormatPattern("##;(##)");


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Consider CONPUTEing the MKU as needed BEFORE it goes to the HOLD file. Maybe like this:
COMPUTE MKU2/D12.2=ABS((-0.25)*DEALER_COST);
or some other way...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
Waz, when I hold the graph using that format, it reverts to a negative sign again in the picture.

Doug, if I calculate the ABS value the graph won't display properly, it is negative number and needs to be plotted as such. The user (don't you just love them) just wants to display the value without the negative sign but plot it as a negative number.

Thanks for the suggestions.


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Platinum Member
posted Hide Post
Here you go

TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
COMPUTE MGN/D12.2=RETAIL_COST-DEALER_COST;
COMPUTE MKU/D12.2=(-0.25)*DEALER_COST;
COMPUTE COST/D12.2=DEALER_COST+MKU;
BY CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS TESTDATA FORMAT ALPHA
END
GRAPH FILE TESTDATA
SUM
MKU AS ''
BY CAR AS ''
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHSTYLE *
setFontSizeAbsolute(getDataText(),true);
setFontName(getDataText(),"Arial");
setCustomDataText(getDataText(0),false);
setDisplay(getDataText(),true);
setDataTextFormat(-1);
setDataTextFormatPattern("(##);##");
setPlaceResize(getDataText(),0);
setFontSize(getDataText(),6);
setFontStyle(getDataText(),0);
setFillColor(getDataText(),new Color(0,0,0));
setPlacePosition(getDataText(),1);
ENDSTYLE
END


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
 
Posts: 165 | Registered: September 29, 2008Report This Post
<FreSte>
posted
Atturhari,

I modified your example a bit (when you have both positive and negative values, the positive values are shown
between brackets). I changed

setDataTextFormatPattern("(##);##"); in
setDataTextFormatPattern(" ##;##");


... plus now the graph has green and red bars, depending on the values.

TABLE FILE CAR
SUM
DEALER_COST 
RETAIL_COST 
COMPUTE MGN/D12.2=RETAIL_COST-DEALER_COST;
COMPUTE FCTR/D5.2 = IF COUNTRY IN ('JAPAN','ENGLAND') THEN -1 ELSE 1;
COMPUTE MKU/D12.2=FCTR*DEALER_COST;
COMPUTE COST/D12.2=DEALER_COST+MKU;
BY CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS TESTDATA FORMAT ALPHA
END
GRAPH FILE TESTDATA
SUM
MKU AS ''
BY CAR AS ''
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHSTYLE *
setDepthRadius(0);
setFontSizeAbsolute(getDataText(),true);
setFontName(getDataText(),"Arial");
setCustomDataText(getDataText(0),false);
setDisplay(getDataText(),true);
setDataTextFormat(-1);
setDataTextFormatPattern(" ##;##");
setPlaceResize(getDataText(),0);
setFontSize(getDataText(),9);
setFontStyle(getDataText(),0);
setFillColor(getDataText(),new Color(0,0,0));
setPlacePosition(getDataText(),1);
ENDSTYLE
ON TABLE SET STYLE *
TYPE=DATA, COLOR=RED, WHEN=MKU LT 0 ,$
TYPE=DATA, COLOR=LIME, WHEN=MKU GE 0 ,$
END
 
Report This Post
Platinum Member
posted Hide Post
The above codes all work for me when the graph is output to screen.However when I insert the following

 ON GRAPH HOLD AS TEST FORMAT PNG 


and look at the png file generated the values are shown with the minus sign. The same happens when I use JPEG or SVG.

Are you getting the same behaviour when you save the image or is it just me with that issue?


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Platinum Member
posted Hide Post
I dont see any issue. I tried SVG format.


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
 
Posts: 165 | Registered: September 29, 2008Report This Post
Platinum Member
posted Hide Post
In that case may be its an issue with 765. I can tell the user they'll have to wait until we upgrade to a more recent version


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Minus Sign Graph Data Text

Copyright © 1996-2020 Information Builders