Focal Point
Graph Issue: Big value and small value

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

April 01, 2008, 03:44 AM
BHS6868
Graph Issue: Big value and small value
Dear All,

Just wondering if anyone have encountered the following problem.

I have a graph where the Max value is about 1000 and the minimum value is 1. However because the graph is set at a certain size, the bar for the value 1 is never displayed because the scale is too big to display this value 1.

Example of code:

TABLE FILE CAR
PRINT COUNTRY
COMPUTE OPEN/D10 = 659;
COMPUTE CLOSE/D10 = 1;
ON TABLE HOLD AS TEMP1
END

GRAPH FILE TEMP1
SUM OPEN CLOSE
ACROSS COUNTRY
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 ON
ON GRAPH SET VAXIS 3.3
ON GRAPH SET HAXIS 8.0
ON GRAPH SET GRAPHSTYLE *
setSize(650,350);
setO1TitleString("Country");
setY1TitleString("Value");
setTitleString("Event Graph");
setTextJustHoriz(getTitle(),1,);
-*setLineWidth(getSeries(2), 1);
setTextRotation(getO1Label(0),0);
-*setSeriesType(2,2);
setO1MajorGridDisplay(false);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,1);
setAxisAssignment(2,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(true);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(false);
setLegendDisplay(true);
setFontSizeAbsolute(getTitle(),true);
setFontSize(getTitle(),16);
setTextRotation(getTitle(),0);
setTextWrap(getTitle(),true);
setTextJustHoriz(getLegendText(),1);
setFontSizeAbsolute(getLegendText(),true);
setFontSize(getLegendText(),10);
setTextRotation(getLegendText(),0);
setTextWrap(getLegendText(),true);
setTextJustHoriz(getY1Label(),1);
setFontSizeAbsolute(getY1Label(),true);
setFontSize(getY1Label(),10);
setTextRotation(getY1Label(),0);
setTextWrap(getY1Label(),true);
setTextJustHoriz(getO1Label(),1);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),9);
setTextRotation(getO1Label(),0);
setTextWrap(getO1Label(),true);
setPlaceResize(getTitle(),0);
setPlaceRotate(getTitle(),0);
setPlaceAlign(getTitle(),0);
setPlaceWordWrap(getTitle(),0);
setPlaceResize(getLegendText(),0);
setPlaceRotate(getLegendText(),0);
setPlaceAlign(getLegendText(),0);
setPlaceWordWrap(getLegendText(),0);
setPlaceResize(getY1Label(),0);
setPlaceRotate(getY1Label(),0);
setPlaceAlign(getY1Label(),0);
setPlaceWordWrap(getY1Label(),0);
setPlaceResize(getO1Label(),0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setPlaceWordWrap(getO1Label(),1);
setFontSizeAbsolute(getDataText(0),true);
setFontSizeAbsolute(getDataText(1),true);
setFontSize(getDataText(0),12);
setFontSize(getDataText(1),12);
setY1ScaleMaxAuto(true);
setPlace(true);
ENDSTYLE
END
-EXIT

I Need to show the bar for value 1 as well. I know if I increase the graph size, the bar for value 1 will be displayed...but are there other alternatives?

Thanks in advance.


WebFOCUS 767 Server 64bit On Windows 2003 Server

WebFOCUS 767 Server for Developer Studio On windows XP

April 01, 2008, 04:38 AM
GamP
I think the only thing you can do is to decerease the scaling of the y-axis.
This is done with the following statements:

setY1ScaleMaxAuto(false);
setY1ScaleMax(80.0);

(the value of 80 is a suggestion and you can specify any value you like).

This will at least show a low bar but with coloring for the 1-value.
Disadvantage is that there is no indication of the fact that the other bars are much higher than actually shown. Upside is that the actual (high) values are shown as hover-text.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 01, 2008, 04:44 AM
Ved
It it okay with you to have the minimum scale of the graph set to a negative value instead of 0 (say -50)? I suppose if you do that you will always see each and every bar.


Web Focus 7.1.6
Hosted on Unix Box
April 01, 2008, 04:47 AM
Tony A
How about using a dual axis graph format?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 01, 2008, 09:20 AM
GinnyJakes
You can use a log scale so that as the numbers get bigger, the amount of space between the ticks is smaller. This is a selection on the graph assitant. Look in properties for the y axis.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
April 02, 2008, 04:01 AM
BHS6868
Dear All,

Thanks for all the response. So far the user is ok with extending the graph size, so will be using approach.

Thanks.


WebFOCUS 767 Server 64bit On Windows 2003 Server

WebFOCUS 767 Server for Developer Studio On windows XP