Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Pie Graph display problem
Go
New
Search
Notify
Tools
Reply
  
Pie Graph display problem
 Login/Join
 
Member
posted
I'm trying to display a 3D pie graph with a legend. This graph will appear in a pdf to the right of a grid laid out something like this

------------+-------
AssetType | % Par
============+=======
HYL | 76.03
------------+-------
HYB | 10.07
------------+-------
REV | 9.42
------------+-------
SWAP CLN | 1.72
------------+-------
IGL | 0.85
------------+-------
CASH | 0.15
------------+-------[/code]I can get the pie with feeler labels showing the percentages, but the colored legend to the right only shows "-- ------" for a label.

How can I get the AssetType column to appear as a legend?

Data Code:
[code]FILEDEF ASSETGR DISK &ASSETGRPATH
SET GRAPHSERVURL=http://IMWFPR01/ibi_apps/IBIGraphServlet
IBIGraphServlet
SET LOOKGRAPH=PIE
SET GRAPHEDIT=SERVER
SET 3D=ON
GRAPH FILE ATHOLD
HEADING CENTER
"Aggregate Investments By Asset Type"
-IF '&Type.EVAL' EQ 'ALL' THEN GOTO PRINT_AT;
"As Of: &DisplayDate"
-PRINT_AT
PRINT
AssetTypeID
GRA_PctPar AS '% Par'

ON GRAPH SET GRAPHSTYLE *
setAutofit(getLegendText(),true);
setAutoshading(true);
setLegendTextAutofit(true);
setLegendDisplay(true);
setLegendAutomatic(true);
setTitleString("Aggregate Investments by Asset Type");
setTextJustHoriz(getTitle(),1);
setPieTilt(45);
setPieDepth(80);
setFontSize(getTitle(),12);
We're on 5.2.4

Thanks in advance!

This message has been edited. Last edited by: <Mabel>,
 
Posts: 21 | Location: Springfield, MA | Registered: August 17, 2004Reply With QuoteReport This Post
Guru
posted Hide Post
Shouldn't "AssetTypeID" be a BY field?
 
Posts: 391 | Location: California | Registered: April 14, 2003Reply With QuoteReport This Post
Member
posted Hide Post
You're right - should be a BY field!

Code now reads:

FILEDEF ASSETGR DISK &ASSETGRPATHSET
GRAPHSERVURL=http://IMWFPR01/ibi_apps/IBIGraphServletIBIGraphServlet
SET LOOKGRAPH=PIE
SET GRAPHEDIT=SERVER
SET 3D=ON
GRAPH FILE ATHOLD
HEADING CENTER"Aggregate Investments By Asset Type"
-IF '&Type.EVAL' EQ 'ALL' THEN GOTO PRINT_AT;
"As Of: &DisplayDate"
-PRINT_AT
PRINT
GRA_PctPar AS '% Par'
BY AssetTypeID
ON GRAPH SET GRAPHSTYLE *
setAutofit(getLegendText(),true);
setAutoshading(true);
setLegendTextAutofit(true);
setLegendDisplay(true);
setLegendAutomatic(true);
setTitleString("Aggregate Investments by Asset Type");
setTextJustHoriz(getTitle(),1);
setPieTilt(45);
setPieDepth(80);
setFontSize(getTitle(),12);

ENDSTYLE
ON GRAPH HOLD AS ASSETGR FORMAT GIF

END[/code]Same result, though ....

This message has been edited. Last edited by: <Mabel>,
 
Posts: 21 | Location: Springfield, MA | Registered: August 17, 2004Reply With QuoteReport This Post
Guru
posted Hide Post
I've tried your code on another pie chart and gotten labels on the legend. There may be something different about your data?
 
Posts: 391 | Location: California | Registered: April 14, 2003Reply With QuoteReport This Post
Member
posted Hide Post
Thanks for bearing with me.

I've isolated my graphing code out of the main procedure so that it just displays the graph (without the accompanying grid).

Now I see zeros in the Legend text area! As a matter of fact, now that the chart loads as a java applet (as opposed to being embedded as a GIF), I can run the mouse over each pie slice and get a tooltip showing 0 (DataText) on the top, followed by the '% Par' , followed by the actual data value.

Looking at the underlying source reveals something interesting, though.





The generated java applet settings are in plain site and I notice that the setSeriesLableArray method initializes the AssetType labels that I expect to see as zeros! Hmm... The DataSeries array looks OK.

How do I get the AssetTypeID strings to print here without having to hardcode them?

This message has been edited. Last edited by: <Mabel>,
 
Posts: 21 | Location: Springfield, MA | Registered: August 17, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Shouldn't the values of the BY clause show as legend text??
 
Posts: 21 | Location: Springfield, MA | Registered: August 17, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Got it! (kinda silly, too)

Again, Nicola, you hit it right on your second reply about data. I had to do a join to get data together to perform the ratio calculation. The "joined" column name for AssetTypeID ended up as E02.

I just DEFINEd a new column (AssetType) as /A8 and used the AssetTypeID column from the joined table (ATHOLD). The BY clause refers to the new AssetType field and prints out like a charm.

I'm surprised that the AssetTypeID column could not be used naturally from the joined table. At least in the SQL world there is no guess work like this.

Thanks for your help!
 
Posts: 21 | Location: Springfield, MA | Registered: August 17, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Pie Graph display problem

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.