Focal Point
[SOLVED] Graph Legend Wrap Length

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

October 03, 2008, 12:35 PM
Laurie
[SOLVED] Graph Legend Wrap Length
setTextWrap(getO1Label(),true);

This works great but it wraps at 7 characters. Is there any method to have it wrap at a specific length. 7 Characters is too short.

This message has been edited. Last edited by: Kerry,
October 03, 2008, 01:00 PM
Doug
Laurie,

Would you please provide a sample of "what's wrong with my display"? Preferrably using the CAR file. There is a setRectangle(item) that should help.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 04, 2008, 03:37 AM
<JG>
quote:
setTextWrap(getO1Label(),true);


You can also use setO1LabelWrap(true);

This has the same effect. Wraping is supposed to take place based on breaking at
a space, however if spaces are not available the I believe it breaks based on
available axis / number of labels to avoid overlap.

If you want to break in different location then you need to manually generate the labels
and embed \n into the string for example 'The cat\nsat on the mat'

displays as

The cat
sat on the mat

To see how to generate your own labels look at the following post

https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/3761048992
October 10, 2008, 11:13 AM
Laurie
I will try to create an example today. This is still a problem.
October 10, 2008, 12:02 PM
Laurie
Can someone help me try to create a bar graph with the car file using either warranty or standard. Those are the only fields that have data long enough to wrap but I can't use any fields available for the X axis. The error I receive is ALL VERB OBJECTS MUST BE IN THE SAME PATH AS THEIR SORT FIELDS. So as far as I can tell you can't use either of those fields in a bar graph.
October 10, 2008, 12:39 PM
GinnyJakes
The simplest solution, without seeing your code, would be to do a PRINT * against the CAR file and hold it. Then graph against the flat hold file.

The other thing you can do is post your current code so we can see what you are doing.


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
October 10, 2008, 01:21 PM
Laurie
Since I can't use the wizard I am unsure of the syntax. The error is the same as before.
ALL VERB OBJECTS MUST BE IN THE SAME PATH AS THEIR SORT FIELDS


TABLE FILE CAR
SUM
WEIGHT
STANDARD
ON TABLE HOLD AS WFGRAPH
END

GRAPH FILE WFGRAPH
SUM WEIGHT
BY STANDARD
ON GRAPH PCHOLD AS HOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
...
October 10, 2008, 01:37 PM
GinnyJakes
TABLE FILE CAR
PRINT WEIGHT
STANDARD
ON TABLE HOLD AS WFGRAPH FORMAT ALPHA
END

GRAPH FILE WFGRAPH
SUM WEIGHT
ACROSS STANDARD
ON GRAPH PCHOLD AS HOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
END


Does this help?

Why can't you use the wizard?


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
October 10, 2008, 01:48 PM
Laurie
Your code produces the following error:

MERGE DIMENSIONS EXCEED THE NUMBER OF SORT FIELDS

The wizard won't allow me use any field for the X axis with the STANDARD field for the Y axis.
October 10, 2008, 02:09 PM
Doug
What value do you have for the following setting (true or false)?
setLegendTextAutofit(???);




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 10, 2008, 05:14 PM
Laurie
I am using a combination of methods to display the text so it fits correctly below the bar graph.

setFontSizeInPoints(getY1Label(),6);
setTextRotation(getO1Label(),3);
setLegendTextAutosize(true);
setTextWrap(getO1Label(),true);

Thanks for your help.
October 11, 2008, 04:06 AM
<JG>
quote:
The wizard won't allow me use any field for the X axis with the STANDARD field for the Y axis.

Of cause it will not. You can not have an alpha column for the Y axis, It must be Numeric.

So STANDARD is not valid for the Y axis but CNT.STANDARD would be