April 01, 2008, 03:44 AM
BHS6868Graph 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.
April 01, 2008, 04:38 AM
GamPI 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 ...