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     [SOLVED] Pie Graph Multi - Customization
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Pie Graph Multi - Customization
 Login/Join
 
Gold member
posted
Hello

I am working on Pie graph multi and I am not able to customize it. Is there a way to display these pies in specific number of rows and columns?
And I am trying to have legend only once instead of all graphs. Is that possible? I searched forum but not able to find much on multi pie graphs.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY NOPRINT
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPieFeelerTextDisplay(1);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, PAGESIZE=LEGAL, $
TYPE=DATA, COLUMN=N1, BUCKET=page, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"agnosticSettings": {
    "chartTypeFullName": "Pie_Multi"
}
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH  


Please suggest. Thank you.

This message has been edited. Last edited by: WebFOCUS_Dev,


WebFOCUS 8202
All formats
 
Posts: 71 | Registered: September 13, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Changing the
ON GRAPH SET GRWIDTH 1

from 1 to any other value will generates as many pie side by side as the number you put but each graph will have its own legend since it may vary from one to another
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
SUM RETAIL_COST
BY CAR.ORIGIN.COUNTRY NOPRINT
BY CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 2
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPieFeelerTextDisplay(1);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, PAGESIZE=LEGAL, $
TYPE=DATA, COLUMN=N1, BUCKET=page, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"agnosticSettings": {
    "chartTypeFullName": "Pie_Multi"
}
*END[code
ENDSTYLE
END
-RUN

One way to have one legend displayed, I suggest that you hide all legend from the graph and add another report that just contain and display the legend (such as only display HEADING with appropriated colors).
The problem is that you need to be sure that each series is always in the same order on any pie which can be a nightmare. But work great with Year or something that will not vary.

Pie Graph
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='200.0';
-DEFAULTH &WF_STYLE_WIDTH='300.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
DEFINE FILE GGSALES
YEAR /YY = DATE;
END
GRAPH FILE GGSALES
SUM DOLLARS
BY REGION NOPRINT
BY YEAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 2
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPieFeelerTextDisplay(1);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, PAGESIZE=LEGAL, $
TYPE=DATA, COLUMN=N1, BUCKET=page, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);

-* To hide the legend
setDisplay(getLegendArea(),false);

-* To specify series color
setTransparentBorderColor(getSeries(0), true);
setFillColor(getSeries(0),new Color(128,128,128));
setTransparentBorderColor(getSeries(1), true);
setFillColor(getSeries(1),new Color(255,128,64));
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"agnosticSettings": {
    "chartTypeFullName": "Pie_Multi"
}
*END
ENDSTYLE
END
-RUN

Legend Report
DEFINE FILE GGSALES
YEAR /YY = DATE;
END
GRAPH FILE GGSALES
BY YEAR
ON TABLE HOLD AS YRDATA
END
-RUN
-DEFAULTH &I = 0
-REPEAT READYR &LINES TIMES
-SET &I = &I + 1;
-READFILE YRDATA
-SET &YR&I.EVAL = &YEAR;
-TYPE &YR&I.EVAL
-RUN
-READYR

TABLE FILE CAR
BY COUNTRY NOPRINT
WHERE READLIMIT   EQ 1;
WHERE RECORDLIMIT EQ 1;
HEADING
"  &YR1  "
"  &YR2  "

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
  BORDER=OFF,
$
TYPE=HEADING,
  LINE=1,
  STYLE=BOLD,
  COLOR=WHITE,
  BACKCOLOR=RGB(128 128 128),
$
TYPE=HEADING,
  LINE=2,
  STYLE=BOLD,
  COLOR=WHITE,
  BACKCOLOR=RGB(255 128 64),
$
END
-RUN


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2234 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks Martin. These suggestions worked well for me. I did my other customization works and no issues.
Finally when I try to insert this in iframe, it displays in large size with scrolls. I tried working with iframe properties but did not see anything that helped.

Please try inserting this in iframe with height 350px and width 650 px. Whatever the iframe size is, I see only 1st pie displaying in it and all other pies will show only when scrolled. But if I display it in new window instead of iframe, they show up well in size as specified.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='150.0';
-DEFAULTH &WF_STYLE_WIDTH='200.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY NOPRINT
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 3
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPieFeelerTextDisplay(1);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, PAGESIZE=LEGAL, $
TYPE=DATA, COLUMN=N1, BUCKET=page, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getLegendArea(),false);
setPieSliceDetach(getSeries(*), 75);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"agnosticSettings": {
    "chartTypeFullName": "Pie_Multi"
}
*END
ENDSTYLE
END


WebFOCUS 8202
All formats
 
Posts: 71 | Registered: September 13, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Add this :
-SET &WF_STYLE_UNITS='PIXELS';
-SET &WF_STYLE_HEIGHT='150.0';
-SET &WF_STYLE_WIDTH='200.0';

I don't know why but if you only keep the size as DEFAULTH values, the graph engine is not "reading" them and display as if you have one graph per row and filed all the available space

I already encounter the same issue and got the "solution" from a case that I had open.
Took me a will to remember that "little" thing and share to you


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2234 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
Thank you so much. That worked.
quote:
Originally posted by MartinY:
Add this :
-SET &WF_STYLE_UNITS='PIXELS';
-SET &WF_STYLE_HEIGHT='150.0';
-SET &WF_STYLE_WIDTH='200.0';

I don't know why but if you only keep the size as DEFAULTH values, the graph engine is not "reading" them and display as if you have one graph per row and filed all the available space

I already encounter the same issue and got the "solution" from a case that I had open.
Took me a will to remember that "little" thing and share to you


WebFOCUS 8202
All formats
 
Posts: 71 | Registered: September 13, 2017Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Pie Graph Multi - Customization

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