Focal Point
[SOLVED] Scatter Plot with 4 Quadrants

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

July 16, 2018, 04:40 PM
BI Dev
[SOLVED] Scatter Plot with 4 Quadrants
Hi Everyone,

I was wondering if there is a way to create a scatter plot with 4 quadrants in webfocus like the one in the image below? I have two columns with integer values and I need to create a 4 quadrant scatter plot. Thanks in advance.

Scatter chart Image

This message has been edited. Last edited by: FP Mod Chuck,


Webfocus 8105/8202
Windows
All Outputs
July 16, 2018, 10:15 PM
BabakNYC
Yes. Use the Scatter plot and set a min and max for the X and Y axis that will create the 4 quadrants. Here's an example.

  

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
-DEFAULTH &WF_HTMLENCODE=OFF;
SET HTMLENCODE=&WF_HTMLENCODE

SET ARGRAPHENGINE=JSCHART
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT

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 WF_RETAIL
-* Created by Info Assist for Graph
SUM WF_RETAIL.WF_RETAIL_SALES.DISCOUNT_US
WF_RETAIL.WF_RETAIL_SALES.GROSS_PROFIT_US
BY WF_RETAIL.WF_RETAIL_CUSTOMER.FULLNAME
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
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 SCATTER
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
setUseSeriesShapes(true);
setScaleMustIncludeZero(getX1Axis(), false);
setScaleMustIncludeZero(getY1Axis(), false);
setScaleMustIncludeZero(getY2Axis(), false);

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=DATA, COLUMN=N1, BUCKET=detail, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=x-axis, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);
setScaleMinAuto(getY1Axis(),false);
setScaleMin(getY1Axis(),-10000.0);
setScaleMaxAuto(getY1Axis(),false);
setScaleMax(getY1Axis(),10000.0);
setScaleMinAuto(getX1Axis(),false);
setScaleMin(getX1Axis(),-10000.0);
setScaleMaxAuto(getX1Axis(),false);
setScaleMax(getX1Axis(),10000.0);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"agnosticSettings": {
    "chartTypeFullName": "X_Y_Plots_Scatter"
}

*END
ENDSTYLE
END

-RUN



WebFOCUS 8206, Unix, Windows
April 29, 2019, 02:38 PM
rkiran1
Can we set color for each of the quadrant


Version 8.2.03
Output : HTML, Excel & PDF
April 29, 2019, 02:55 PM
BabakNYC
I doubt it.


WebFOCUS 8206, Unix, Windows
April 30, 2019, 08:20 AM
rkiran1
On further research, I found the below link which shows different colors for each quadrant. They use getReferenceRect(), but i am not able to replicate it.

getReferenceRect()

 setBorderColor(getReferenceRect(0),new Color(255,111,111));
setDisplay(getReferenceRect(0),true);
setFillColor(getReferenceRect(0),new Color(255,111,111));  setX1(getReferenceRect(0),
0.0); setY1(getReferenceRect(0), 0.0); setX2(getReferenceRect(0),
0.5); setY2(getReferenceRect(0), 0.5);setReferencePercentageMode(getReferenceRect(0),true);

setDisplay(getReferenceRectText(0), true); 
setReferenceTextPosition(getReferenceRectText(0), 6); 
setTextString(getReferenceRectText(0), "Custom Peach  ");
  



Version 8.2.03
Output : HTML, Excel & PDF