Focal Point
Legend for Second BY Field

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

August 23, 2013, 08:07 AM
Sivashankari Venkataraman
Legend for Second BY Field
All,
Please see the example CAR Graph file code pasted below. There are 2 BY fields in the Graph code and i have set GMERGE=ON. My requirement is to sort the legend descending by RETAIL_COST but display the CAR names in the legend. But ,currently i am getting the RETAIL_COST values getting displayed in the legend. Any help is much appreciated.


GRAPH FILE CAR
SUM
COMPUTE MTRC/D12 = SALES;
BY HIGHEST RETAIL_COST AS '' NOPRINT
BY CAR
ACROSS COUNTRY AS ''
FOOTING
""
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO ON
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 950
ON GRAPH SET VAXIS 250
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBIDefault.txt");
setTransparentBorderColor(getChartBackground(),false);
-*setTransparentBorderColor(getChartBackground(),true);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(0);
setPlace(true);
setDisplay(getY1Label(),true);
setTextString(getO1Title(),"");
setTextString(getY1Title(),"");
setDisplay(getTitle(),true);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),10);
setPlaceResize(getTitle(),0);
setDisplay(getO1MajorGrid(),true);
setDisplay(getO1MinorGrid(),false);
setLineWidth(getY1MajorGrid(),0);
setLineBasicStrokeType(getY1MajorGrid(),0);
setMajorGridDrawEveryCount(getY1MajorGrid(),1);
setGridStyle(getY1MajorGrid(),0);
setDisplay(getY1MinorGrid(),false);
setDisplay(getO1Label(),true);
setDisplay(getLegendArea(),true);
setFontSizeInPoints(getDataText(0),30);
setPlaceResize(getDataText(0),0);
setFontSizeAbsolute(getDataText(0),false);
setFontSizeAbsolute(getO1Label(),true);
setFontSizeInPoints(getO1Label(),8);
setPlaceResize(getO1Label(),0);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),8);
setPlaceResize(getY1Label(),0);
setTextFormatPattern(getY1Label()," 0000");
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),8);
setPlaceResize(getLegendText(),0);
setDataLineThickness(5);
setTextRotation(getO1Label(),0);
setLegendDisplay(getSeries(1),true);

-* determines angle of X axis labels
setTextRotation(getO1Label(),3);
-*******************************************
-* Legend commands
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),8);
setLegendPosition(2);
setPlaceResize(getLegendText(),0);
setRect(getLegendArea(), new Rectangle(0, 0, 2000, 16000));
-* synchs the series marker shapes (setMarkerSize) with the legend
-*setUseSeriesShapes(true);

ENDSTYLE
END


Webfocus 7702
Unix
All outputs
August 28, 2013, 02:35 PM
<Kathryn Henning>
Hi Sivashankari,

I'd like to recommend opening a case on InfoResponse Online to work through this issue.

Regards,

Kathryn
August 29, 2013, 10:52 AM
linnex
Hi,

while I could not find a "complete" solution to your problem, maybe the following work-around will help while waiting for an answer from IBI-support:

 
TABLE FILE CAR
SUM
  SALES
  COMPUTE ROW_NUM/I4 = LAST ROW_NUM + 1;
  COMPUTE NUMERATED_CAR/A60 = FTOA(ROW_NUM, '(D4c)', 'A4') || ' ' | CAR;
BY HIGHEST RETAIL_COST
BY CAR 
BY COUNTRY
ON TABLE HOLD AS HTMP FORMAT FOCUS
END

GRAPH FILE HTMP
SUM
COMPUTE MTRC/D12 = SALES;
-* BY HIGHEST RETAIL_COST AS '' NOPRINT
BY NUMERATED_CAR
ACROSS COUNTRY AS ''
....


The drawback: you will not get the actual "CAR" as string but "1 MASERATI", "2 BMW"... but at least you can generate the desired ordering + have the CAR (string) you want included in the legend.

Cheers Linne


WebFOCUS 7.7.03
September 13, 2013, 05:44 AM
Sivashankari Venkataraman
Thanks for the comments Linnex and Kathryn


Webfocus 7702
Unix
All outputs