Focal Point
Graph Question
July 31, 2007, 04:40 PM
KameshGraph Question
I am trying to set the Y1 axis with the maximum amount. The problem I am getting is, the interval is showing based on the maximum amount value but the top one shows the nearest amount and stops the Y1 axis with the maximum amount.
Ex: the Y1 axis is shown as below,
4M *(3.59M)
3M
2M
*(1.78M)
1M *(1M)
0
The graph should show as below,
4M
*(3.59M)
3M
2M
*(1.78M)
1M *(1M)
0
Hope I put my questions in proper manner,
WFConsultant
WF 8105M on Win7/Tomcat
July 31, 2007, 04:49 PM
FrankDutchno, I don't understand this...
please try to post a real example of the graph and maybe the script how you got it.
To post an image you have to upload the image to a public site.
|
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 |
August 01, 2007, 04:25 AM
Tony AKamesh,
You would need to turn off the Max scale auto and then set it to a value that you require, If this is variable then you would need to perform a small extract to obtain the max value you require.
The Java code for this would be something like -
setY1ScaleMax(&Max);
setY1ScaleMaxAuto(false);
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 | |
August 01, 2007, 09:11 AM
KameshThat's what I did Tony but it ends with the maximum value. I mean if the maximum value is 75k and the Y1 axis interval increases with 10k, the Y1 axis shows 80k but it stops at 75k.
WFConsultant
WF 8105M on Win7/Tomcat
August 01, 2007, 10:26 AM
Tony AKamesh,
Put together an example using one of the sample database (such as GGSALES) with the
minimal code to demonstrate what you are doing.
I would expect to see something like this and not much more for an example piece -
-SET &Max = 18000;
-RUN
GRAPH FILE GGSALES
SUM DOLLARS
BUDDOLLARS
BY REGION
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *
setGraphType(45);
setY1ScaleMax(&Max);
setY1ScaleMaxAuto(false);
ENDSTYLE
END
-RUN
If you can't get it stripped down to a reasonable size, then just remove code whilst it still displays your problem and then post.
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 | |
August 01, 2007, 02:54 PM
KameshThe sample code is below. If you see the output, the Y1 axis will end with $195,587 but it should go up to 200k.
SET HAXIS=900
SET VAXIS=510
SET GRMERGE=ON
SET GRAPHEDIT = SERVER
GRAPH FILE GGSALES
SUM UNITS DOLLARS
BY REGION
ACROSS PRODUCT
WHERE RECORDLIMIT EQ 10
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTextString (getTitle(),"BY REGION");
setY1TitleString("TEST");
setO1TitleString("TEST STRING");
setPlaceResize(getO1Label(),0);
setFontSizeAbsolute(getO1Label(),true);
setDataTextDisplay(true);
setFillMissingData(0);
setY1ScaleMaxAuto(false);
setScaleMax(getY1Axis(), 195587 );
ENDSTYLE
END
-EXIT
WFConsultant
WF 8105M on Win7/Tomcat
August 01, 2007, 03:16 PM
FrankDutchquote:
setScaleMax(getY1Axis(), 195587 );
this is what you say and that is what the report does.
change it in
setScaleMax(getY1Axis(), 200000 );
and see if this helps
|
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 |
August 01, 2007, 03:26 PM
KameshThe problem is I dont know the maximum value. I am setting it dynamincally based on data.
WFConsultant
WF 8105M on Win7/Tomcat
August 01, 2007, 05:19 PM
Tony AKamesh,
If you are setting it dynamically then I guess that you are performing a previous extract, saving the output and reading it into a variable? If so then just round it up to the next value you want. i.e. if your max value extracted is 195 and you want to have the max at 200 then newmax = int((extr_max / 100) + .5) * 100 or something of the ilk.
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 | |
August 02, 2007, 10:01 AM
KameshThanks Tony for your idea. It's sounds like working with some modification.
-SET &MAXTOT=195587;
-SET &MAXTOT1=IF &MAXTOT NE 0 THEN &MAXTOT/100 ELSE 0;
-SET &MAXTOTLEN=IF &MAXTOT NE 0 THEN ARGLEN(21,&MAXTOT1,'I8') ELSE 1;
-SET &MAXTOT=IF &MAXTOTLEN EQ 1 THEN INT((&MAXTOT1+.5)*100)
- ELSE IF &MAXTOTLEN EQ 2 THEN INT((&MAXTOT1+5)*100)
- ELSE IF &MAXTOTLEN EQ 3 THEN INT((&MAXTOT1+50)*100)
- ELSE IF &MAXTOTLEN EQ 4 THEN INT((&MAXTOT1+500)*100)
- ELSE IF &MAXTOTLEN EQ 5 THEN INT((&MAXTOT1+5000)*100)
- ELSE IF &MAXTOTLEN EQ 6 THEN INT((&MAXTOT1+50000)*100)
- ELSE IF &MAXTOTLEN EQ 7 THEN INT((&MAXTOT1+500000)*100)
- ELSE IF &MAXTOTLEN EQ 8 THEN INT((&MAXTOT1+5000000)*100)
- ELSE IF &MAXTOTLEN EQ 9 THEN INT((&MAXTOT1+50000000)*100)
- ELSE &MAXTOT;
SET HAXIS=900
SET VAXIS=510
SET GRMERGE=ON
SET GRAPHEDIT = SERVER
GRAPH FILE GGSALES
SUM UNITS DOLLARS
BY REGION
ACROSS PRODUCT
WHERE RECORDLIMIT EQ 10
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTextString (getTitle(),"BY REGION");
setY1TitleString("TEST");
setO1TitleString("TEST STRING");
setPlaceResize(getO1Label(),0);
setFontSizeAbsolute(getO1Label(),true);
setDataTextDisplay(true);
setFillMissingData(0);
setY1ScaleMaxAuto(false);
setScaleMax(getY1Axis(), &MAXTOT );
ENDSTYLE
END
-EXIT
WFConsultant
WF 8105M on Win7/Tomcat
August 02, 2007, 12:55 PM
KameshThis solution works perfect. The idea I got it from this link
https://forums.informationbuilders.com/eve/forums/a/tpc/...811018331#3811018331The modified code is below,
DEFINE FUNCTION D_ROUND(NUMBER/D12.2, BASE/D8)
TMPNUM/D12 = NUMBER;
REMAINDER/D8 = DMOD(NUMBER, BASE, REMAINDER);
TESTVAL/D8 = BASE/2;
RETVAL/D12 = IF REMAINDER GE TESTVAL THEN
TMPNUM + (BASE - REMAINDER)
ELSE TMPNUM + REMAINDER;
D_ROUND/D12 = RETVAL;
END
-SET &MAXTOT=195587;
-SET &MAXTOTLEN=IF &MAXTOT NE 0 THEN ARGLEN(21,&MAXTOT,'I8') ELSE 1;
-SET &MAXTOT=IF &MAXTOTLEN EQ 2 THEN D_ROUND(&MAXTOT,1)
- ELSE IF &MAXTOTLEN EQ 3 THEN D_ROUND(&MAXTOT,10)
- ELSE IF &MAXTOTLEN EQ 4 THEN D_ROUND(&MAXTOT,100)
- ELSE IF &MAXTOTLEN EQ 5 THEN D_ROUND(&MAXTOT,1000)
- ELSE IF &MAXTOTLEN EQ 6 THEN D_ROUND(&MAXTOT,10000)
- ELSE IF &MAXTOTLEN EQ 7 THEN D_ROUND(&MAXTOT,100000)
- ELSE IF &MAXTOTLEN EQ 8 THEN D_ROUND(&MAXTOT,1000000)
- ELSE IF &MAXTOTLEN EQ 9 THEN D_ROUND(&MAXTOT,10000000)
- ELSE &MAXTOT;
SET HAXIS=900
SET VAXIS=510
SET GRMERGE=ON
SET GRAPHEDIT = SERVER
GRAPH FILE GGSALES
SUM UNITS DOLLARS
BY REGION
ACROSS PRODUCT
WHERE RECORDLIMIT EQ 10
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTextString (getTitle(),"BY REGION");
setY1TitleString("TEST");
setO1TitleString("TEST STRING");
setPlaceResize(getO1Label(),0);
setFontSizeAbsolute(getO1Label(),true);
setDataTextDisplay(true);
setFillMissingData(0);
setY1ScaleMaxAuto(false);
setScaleMax(getY1Axis(), &MAXTOT );
ENDSTYLE
END
-EXIT
WFConsultant
WF 8105M on Win7/Tomcat
August 02, 2007, 01:32 PM
Tony A.. and Kamesh demonstrates the excellent history of this forum and the myriad of suggestions contained there in.
Most solutions only require that you think laterally ....
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 | |