Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] not able to display Legend for single values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] not able to display Legend for single values
 Login/Join
 
<amarnath>
posted
Hi ,

I am working on a graph report. I have a problem with the display of legend .
Able to display legend for multiple values but not able to display for single value.
Ex:

I am plotting a graph using one numeric field & one alphanumeric across a month field.
Whenever there are multiple months in the data It is displaying Legend for all the months presented.
But if I have only one month it is not displaying the legend.


I am copying the sample code here (developed using CAR master file). Please check the code once and let me know if u get any clue.

-****************************
-* File testcar.fex
GRAPH FILE CAR
SUM DEALER_COST AS ''
ACROSS MODEL
BY COUNTRY
WHERE COUNTRY EQ 'ITALY'
-* try also commenting above condition
ON GRAPH SET LOOKGRAPH VAREA
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 GRWIDTH 0
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,3);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
LINE=1,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
ENDSTYLE
END



-****************************
Please let me know the solution ASAP



Thanks & Regards
Amarnath.k

This message has been edited. Last edited by: Kerry,
 
Report This Post
Platinum Member
posted Hide Post
It would probably help if you let us know what you are running where it fails.

I've tried this in 7.1.6 WebFOCUS via Adhoc page and the LEGEND shows up for me.


Prod: WebFOCUS 7.1.6, Windows 2003

Dev: WebFOCUS 7.6.2, Windows 2003
 
Posts: 140 | Registered: May 02, 2007Report This Post
Guru
posted Hide Post
I tried the code in version 7.13, and the Legend exists ( a little blue square below the x-axis title), but it is not labelled (you would expect the label of "ITALY").


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Guru
posted Hide Post
Try this for a workaround:

-DEFAULT &VARCTR = 1
-DEFAULT &COUNTRY = 'ITALY'

GRAPH FILE CAR

SUM DEALER_COST AS ''
ACROSS MODEL
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'

-* try also commenting above condition
ON GRAPH SET LOOKGRAPH VAREA
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 GRWIDTH 0
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,3);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);

-IF &VARCTR NE 1 GOTO SKIP_ANNOT;
setDisplay(getAnnotation(0), true);
setTextString(getAnnotation(0), "&COUNTRY");
setRect(getAnnotation(0),new Rectangle(500,-14850,1500,100));
setFillColor(getAnnotation(0), new Color(0,0,0));
-SKIP_ANNOT

setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
LINE=1,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
ENDSTYLE
END


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
Is there another solution to this? I don't think this work around is going to work for me. Why would it not display the Legend Display if it's one value? This makes no sense. If it's only one value...you just should know what it is? Confused


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
JG? Anybody?
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Gold member
posted Hide Post
Amarnath,

Can you tell you which release you are seeing this issue in? I ran your code in both WF 7.6.9 and 7.6.10 releases and saw the legend appear on the chart.
 
Posts: 52 | Registered: January 19, 2007Report This Post
Virtuoso
posted Hide Post
This was an old issue for him...this is my issue now...You see the Word ITALY under the purple square when you run the orginal graph?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
<JG>
posted
Prarie, I have done an internal search and unfortunately it's a known bug supposedly fixed in 7.6.5,
have you tried it on your 7.6.5 test environment.

It does work in 7.6.6 and above.

One possible solution that I saw was instead of coding ON GRAPH SET LOOKGRAPH VAREA
explicitly set the graph type using the API call
e.g. setGraphType(31);

Never know might work.
 
Report This Post
Gold member
posted Hide Post
JG, that's an excellent idea. I actually tried it in Release 7.6.1 and it worked. I modified the original fex to show a working example.

-DEFAULT &VARCTR = 1
-DEFAULT &COUNTRY = 'ITALY'

GRAPH FILE CAR

SUM DEALER_COST AS ''
ACROSS MODEL
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY'

-* try also commenting above condition
-*VLozovsky: changed VAREA to VLINE
ON GRAPH SET LOOKGRAPH VLINE
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 GRWIDTH 0
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
-*VLozovsky: api call below will visualize the line chart as an area
setSeriesType(0,3);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);

-IF &VARCTR NE 1 GOTO SKIP_ANNOT;
setDisplay(getAnnotation(0), true);
setTextString(getAnnotation(0), "&COUNTRY");
setRect(getAnnotation(0),new Rectangle(500,-14850,1500,100));
setFillColor(getAnnotation(0), new Color(0,0,0));
-SKIP_ANNOT

setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
LINE=1,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
ENDSTYLE
END
 
Posts: 52 | Registered: January 19, 2007Report This Post
Virtuoso
posted Hide Post
Vlozovsky -

That work around will not work for me...because the real graph will some days have one value and others have several.

JG I'll try your suggestion.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
<JG>
posted
Come on Prarie wake up, you know better than that.
What's actually missing from the work around is the first step.

TABLE FILE CAR
SUM DEALER_COST AS ''
ACROSS MODEL
BY COUNTRY
ON TABLE SAVE
END
-RUN
-SET &&VARCTR = &LINES;

That accomodates the bypass if more than 1 exists.
 
Report This Post
Virtuoso
posted Hide Post
Yes you are correct I was not awake, and was coming back to say...I got it! Brain was not with me earlier.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] not able to display Legend for single values

Copyright © 1996-2020 Information Builders