Focal Point
[CLOSED] Negative and Positive values as datatext display

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

July 05, 2011, 02:18 AM
panes
[CLOSED] Negative and Positive values as datatext display
Hi,

I have a graph report in which i need to display both positive and negative values. Also i need to display the datatext values ABOVE the vertical bars.Now the issue is the negative datatext values are displaying inside the bars and positive values above the bars. I need all the data text values to display above the bars. Is there a property, so that i can specify data text position to negative values separately. Or some other property to detect the negative datatext values???

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


WebFOCUS 7.6
Windows, All Outputs
July 11, 2011, 08:56 AM
Rajna Nannat
We can have an alternative work around for this as below, in which we are splitting the field as two one having positive and the other having negative value so that we can identify negative and positive values seperatly as a getseries().
Then using the following to identify the negative data:
setTextFormatPattern(getSeries(0),"-###,###");

-SET &V1=0;
-REPEAT LOOP1 2 TIMES
-SET &FLAG = IF &V1  EQ 0 THEN FLAG1 ELSE FLAG2;
-IF &V1 EQ 0 THEN GOTO LABEL1 ELSE GOTO LABEL2;
-LABEL1
FILEDEF FILE1 DISK FILE1
-GOTO SKPLAB2
-LABEL2
FILEDEF FILE1 DISK FILE1 (APPEND
-SKPLAB2
DEFINE FILE CAR
 DIFF/D20=IF COUNTRY EQ 'JAPAN' THEN ( DCOST - RCOST ) ELSE RCOST - DCOST ;
 NEGDIFF/D20=IF DIFF LT 0 THEN -1*DIFF ELSE 0;
 POSDIFF/D20=IF DIFF GT 0 THEN DIFF ELSE 0;
END
TABLE FILE CAR
SUM
COMPUTE FLAG/A6= '&FLAG.EVAL';
COMPUTE DIFF1/D20 = IF FLAG EQ 'FLAG1'      THEN NEGDIFF ELSE 0;
COMPUTE DIFF2/D20 = IF FLAG EQ 'FLAG1'      THEN POSDIFF ELSE 0;
COMPUTE FLAG2/D20  = IF FLAG EQ 'FLAG2' THEN HEIGHT  ELSE 0;
BY COUNTRY
ON TABLE HOLD AS FILE1
END
-SET &V1 = &V1+1;
-LOOP1

TABLE FILE FILE1
PRINT 
FLAG
DIFF1
DIFF2
FLAG2
BY COUNTRY
ON TABLE HOLD AS FNLHOLD
END
GRAPH FILE FNLHOLD
SUM
COMPUTE RATING1/I11 MISSING ON = IF DIFF1 EQ 0 THEN MISSING ELSE DIFF1;
COMPUTE RATING2/I11 MISSING ON = IF DIFF2 EQ 0 THEN MISSING ELSE DIFF2; 
COMPUTE FLAG2/I11  MISSING ON = IF FLAG2  EQ 0 THEN MISSING ELSE FLAG2; 
BY COUNTRY
BY FLAG                                
WHERE  TOTAL DIFF1 NE 0 OR DIFF2 NE 0 OR FLAG2 NE 0;
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET HZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setFillColor(getSeries(0),new Color(255,0,0));
setDepthRadius(5);
setTextRotation(getDataText(),4);
setStackedDataValueSum(false);
setDataTextDisplay(true);
setDataTextPosition(1);
setFontSizeAbsolute(getDataText(5),true);
setFontSizeAbsolute(getDataText(4),true);
setFontSizeAbsolute(getDataText(3),true);
setFontSizeAbsolute(getDataText(2),true);
setFontSizeAbsolute(getDataText(1),true);
setFontSizeAbsolute(getDataText(0),true);
setFontSize(getDataText(5),14);
setFontSize(getDataText(4),14);
setFontSize(getDataText(3),14);
setFontSize(getDataText(2),14);
setFontSize(getDataText(1),14);
setFontSize(getDataText(0),14);
setLegendDisplay(false);
setDisplay(getSubtitle(),true);
setDisplay(getTitle(),true);
setO1MajorGridDisplay(false);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
setFillColor(getFrame(),new Color(180,180,180));
setFillType(getFrame(),1);
setFillColor(getFrameSide(),new Color(255,255,255));
setFillColor(getSeries(1),new Color(255,111,90));
setFillColor(getSeries(2),new Color(255,255,128));
setFillColor(getSeries(3),new Color(146,221,98));
setFillColor(getSeries(4),new Color(27,183,5));
setFillColor(getSeries(5),new Color(118,126,138));
setScaleFromZero(false);
setPlaceResize(getO1Label(),1);
setPlaceSkip(getO1Label(),1);
setLabelStagger(getO1Label(),false);
setLabelMargin(getO1Label(),10);
setDisplay(getDataText(),true);
setFillColor(getSeries(0),new Color(255,153,0)); 
setDataTextDisplay (true);
setTextFormatPattern(getSeries(0),"-###,###");
ENDSTYLE
END



WebFOCUS 8.1.05
Windows
Excel, PDF, HTML