I have a Graph that I'm trying to duplicate from Crystal Reports to WebFocus. It has two horizontal bars and the bars are sectioned into different colors based on how many service calls each person received. Picture this as a graph and each part a different color
Then there is a legend at the left side with a color square and the name of the person.
O Amy Ray O Stevie Nicks O Robert Plant
Graph would be something like this.
GRAPH FILE XGRAPH SUM PRIMCALL SECONDCALL BY NAME AS ' ' END
Of course when you do this you get the 2 bars with each name down the left of the bar. Any thoughts on how to accomplish this. I would figure if you can do it in Crystal...it can be done in Webfocus.
Well that is quite the article....I'm not sure it it can help me...but I'll review it.
Thanks.
March 23, 2005, 08:48 PM
Prarie
Don't think that is what I needed, any other thoughts?
March 23, 2005, 09:20 PM
susannah
Prairie, that's exactly what the GRAPHTYPE article was written to address. absolutely. you'll just build a character string that is itself a TABLE. the first cell is the first bar, of whatever width you need with a color as a background color and a text value right adjusted for the value itself, 2. the 2nd cell is the next bar, of whatever width needed with a new color as a background color and a right-adjusted value, and so on. The 4th cell has a background color white and is empty, of a width needed to fill out the full area alloted for the entire table. It works like a charm, i promise! i do it every day.
March 24, 2005, 02:12 PM
<JG>
Take a look at the following sample. I think it's what you are looking for
SET HOLDLIST=PRINTONLY TABLE FILE CAR SUM SEATS ACROSS BODYTYPE NOPRINT BY COUNTRY WHERE COUNTRY EQ 'ENGLAND' OR 'ITALY'; ON TABLE HOLD AS XX FORMAT ALPHA END CHECK FILE XX HOLD -RUN -* TABLEF FILE HOLD PRINT ALIAS WHERE FLDNO NE 1 ON TABLE HOLD AS FIELDS FORMAT ALPHA END -* TABLE FILE CAR BY BODYTYPE WHERE COUNTRY EQ 'ENGLAND' OR 'ITALY'; ON TABLE HOLD AS ZZ FORMAT ALPHA END TABLEF FILE ZZ PRINT COMPUTE COUNTA/I5= LAST COUNTA +1; NOPRINT COMPUTE COUNTER/I9= COUNTA -1; NOPRINT COMPUTE NLABEL/A80='setSeriesLabel(' || EDIT(COUNTER) || ',"' || BODYTYPE || '");'; ON TABLE HOLD AS LEGEND FORMAT ALPHA END -RUN GRAPH FILE XX SUM -INCLUDE FIELDS BY COUNTRY ON GRAPH SET LOOKGRAPH HBRSTK1 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 PCHOLD FORMAT GIF ON GRAPH SET GRAPHSTYLE * -INCLUDE LEGEND ENDSTYLE ENDThis message has been edited. Last edited by: <Mabel>,
March 24, 2005, 06:39 PM
Prarie
Thanks...that was what I was looking for...now to make it work with my code.
Thanks...so much.
Suzannah..I am going to use your method for something else for sure.
March 29, 2005, 01:56 PM
Prarie
This method worked great and I have a happy Graph now, but the user wants the Legend on the left. I tried using LegendPosition, but it will not let me move it from the right...I guess cause it is an include file. Any thoughts on getting it to the left?
Thanks
March 29, 2005, 02:06 PM
<JG>
Legend positioning is different in 5.3 and above.
What version of WF are you running
March 29, 2005, 02:28 PM
Prarie
Sorry forgot to throw that in, 5.3.2...which is driving me crazy.
March 29, 2005, 02:50 PM
Leo L
for 5.3, I know I had a fun time playing with the graphs.. I still have a hard time believing this was an "upgrade" ... I think I'll end up just coding everything in API.
How to Set the Legend Position setLegendPosition (value); where: value Is one of the following: � FREE FLOAT = -1; � AUTO = 0; � BOTTOM = 1; � RIGHT = 2; � LEFT = 3; � TOP = 4; � RIGHT TOP = 5; � RIGHT BOTTOM = 6; � LEFT TOP = 7; � LEFT BOTTOM = 8; � BOTTOM LEFT = 9; � BOTTOM RIGHT = 10; � TOP LEFT = 11; � TOP RIGHT = 12;
March 29, 2005, 03:08 PM
Prarie
Nope...
March 29, 2005, 03:12 PM
Prarie
Well I type in GRAPHENGINE = NEW...And it worked.. wonder why?
Thanks for you help.
March 29, 2005, 03:23 PM
<JG>
You need to check the WebFocus administrator console, Under Configuration/Client Settings/graph there is a setting for IBIF_GRAPHENGINE. If GRAPH32 is checked then your using the old engine. Unless there are thechnical reasons on your site for having this then, I'd switch to GRAPH53 (new engine) as you then get the higher resolution gif and jpegs as well as the Adobe vector graphs for PDF where the quality is great.
March 29, 2005, 03:38 PM
Leo L
the SET GRAPHENGINE = NEW | OLD would dictate whether to use the new engine for 5.3 or keep using the old 5.2 engine for the graphs. If it was set to "OLD" then the old API coding would have worked. I converted most of my programs over and there was a few things different in the API as well. Therefore some of the old methods would not have worked and/or there were overidding methods like: setLegendPosition(n); when I was converting the programs over.
March 29, 2005, 05:21 PM
Prarie
Well turns out it was set to GRAPH32. I have an inquiry into why. That could explain why a lot of what I'm trying to do...is not working. Thanks for the insight.