Focal Point
Graph one should show one value and label another

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

July 17, 2007, 04:15 PM
Fernando
Graph one should show one value and label another
We wish to create a bar graph where each of the bar shows the difference between 2 fields (diff = new - original) but the label show the original value not the diff. Has anyone done this?

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 22, 2007, 10:35 AM
FrankDutch
Fernando

Please try to create this problem with the CAR database and then post your script here.
This might be a very simple error.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 23, 2007, 10:19 AM
Fernando
Frank,

This is not really a problem as in something going wrong as much as request for how do I do this.

As an example, Say i have data

COMP NEW ORIG DIFF
ABC 10 5 5
BCD 50 35 15
DCE 60 10 50

I will have bar graph with 3 bars graphing DIFF. First one is value 5, 2nd value 15, 3rd value 50. Labels will be ABC, BCD, and DCE. Then the hover will show ABC 5, BCD 15 and DCE 50. I want the hover to show ABC 10, BCD 50 and DCE 60 instead.

How would I do that? Can it even be done?

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 23, 2007, 11:30 AM
FrankDutch
Fernando

I suppose the DIFF is not a database field, so you have to define that field first.

DEFINE FILE whatever
DIFF=NEW-ORIG;
END

GRAPH FILE whatever
SUM DIFF
ACROSS COMP
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID OFF
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setExtendToFrameEdge(true);
setRiserWidth(5);
setRiserWidth(20);
setMarkerDisplay(false);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,2);
setAxisAssignment(1,0);
setSeriesType(1,2);
setAxisAssignment(2,0);
setSeriesType(2,2);
setAxisAssignment(3,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(false);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
END


I think this will work, but you might have to change the styling to your own colors etc.

Do you use the GUI??




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 23, 2007, 11:57 AM
Fernando
Frank,

This creates a graph that displays a bar with the value of DIFF which I want. However, the hover also shows the value of DIFF and I need the hover to show the value of ORIG not DIFF.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 23, 2007, 12:19 PM
FrankDutch
that is a bit more complex, you have to add that value to the "by" string.

DEFINE FILE whatever
ALPHAVALUE/A15 = FTOA(ORIG, '(D12.2)', ALPHAVALUE);
COMP2/A25=COMP|' :'||ALPHAVALUE;
END

Now use the COMP2 in your ACROSS value.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 23, 2007, 04:47 PM
Fernando
Frank,

The labels now shows the text, a colon, the orig number and then diff. The hover shows the same thing. I need to have the label only showing the text not the numbers and the hover not showing diff just orig.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
July 23, 2007, 05:33 PM
FrankDutch
You can change the graph to a stacked bar
the first is the DIFF the second is the ORIG.
make the ORIG color white (or transparent) and then you will see the value. (just a try)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7