Focal Point
Scaling Graph

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

July 13, 2005, 06:39 PM
<wf newbie>
Scaling Graph
I have a graph where sometimes the horizontal axis will go up to 400 and sometimes only up to 20. How can I set the x-axis scaling based on the the max value. eg. scale by 1 if LE 20, scale by 5 if LE 100 and scale by 25 if LE 400.

Here is my code
GRAPH FILE REPORT_SHORTFALLS
SUM REPORT_SHORTFALLS.SHORTFALLG
ACROSS REPORT_SHORTFALLS.CDAY

Any help is greatly appreciated
July 14, 2005, 01:01 PM
Mika Keranen
Hi,

This is how I've determined the "skipcount" of x-axis (across-axis). First, you need to know the number of values for x-axis, in your case the number of REPORT_SHORTFALLS.CDAYs. Then just read this value to a parameter and use it with setO1LabelSkipCount-command.

Hope this helps.
Mika

TABLE FILE EMPDATA
SUM CNT.HIREDATE
-* WHERE DIV EQ 'CE' OR 'WE' ;
ON TABLE SAVE
END
-RUN
-READ SAVE &XCNT.A5
-SET &XSKIP_CNT = IF &XCNT LE 20 THEN 2 ELSE 5 ;
GRAPH FILE EMPDATA
SUM SALARY
ACROSS HIREDATE
-* WHERE DIV EQ 'CE' OR 'WE'
ON GRAPH SET GRAPHSTYLE *
setO1LabelAutoSkip(2);
-* setO1LabelSkipBegin(1);
setO1LabelSkipCount(&XSKIP_CNT);
setO1LabelRotate(3);
ENDSTYLE
END
July 14, 2005, 06:17 PM
susannah
setY1MajorGridStepAuto(false);
setY1MinorGridStepAuto(false);
setY1MajorGridStep(1.0);
setY1ScaleMinAuto(false);
setY1ScaleMaxAuto(false);
setScaleMin(getY1Axis(), &MIN );
setScaleMax(getY1Axis(), &MAX );

heres a clip of my code...see the &MIN and &MAX ?
those values i calculate in my fex.
works like a charm for me. You can switch Y1 to X1, of course.
i got this help from focalpointer JG..thanks JG.