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]how to set specific value range in treemap's color scale?
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]how to set specific value range in treemap's color scale?
 Login/Join
 
Platinum Member
posted
I have following treemap for car:

 

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_ARVERSION=2;
SET ARVERSION=&WF_ARVERSION

-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ibisamp/car

SUM CAR.BODY.DEALER_COST CAR.BODY.RETAIL_COST
BY CAR.COMP.CAR

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
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 TREEMAP
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setPlace(true); 

setCurveFitEquationDisplay(false); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, JUSTIFY=RIGHT, $

TYPE=HEADING, LINE=2, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=NORMAL, COLOR=RGB(255 128 0), $

*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

setLegendPosition(4);
*GRAPH_JS_FINAL

"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "orientation": "horizontal"
},
"riserBevel": "lighten",

"agnosticSettings": {
    "chartTypeFullName": "Treemap"
},


*END
ENDSTYLE
END

-RUN


 


When this code is ran, there is color red to green(from left to right) to show Green is highest number while red is lowest.
My objective is to set specific value as middle color(which is bright yellow) instead by average range. Example, I want to set 10K as in middle(bright yellow) any number above 10k should be more like greenish color, and below 10k will be closer to red color.
Any idea?

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


WebFOCUS v8.2.06 , Windows
 
Posts: 124 | Registered: August 29, 2019Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Looking through Creating HTML5 Charts With WebFOCUS Language gave me this idea:
 
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=OFF
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF

GRAPH FILE ibisamp/car
SUM CAR.BODY.DEALER_COST
    CAR.BODY.RETAIL_COST 
 BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH TREEMAP
ON GRAPH SET AUTOFIT ON
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET STYLE *
*GRAPH_JS
    "legend": {"visible": false},
 	"colorScale": {
	    "colorMode":"discrete",
		"colors": [
			{"start":    0, "stop":     9999,"color":"red"},
			{"start":10000, "stop":    10000,"color":"yellow"},
			{"start":10001, "stop":999999999,"color":"green"}
		],
	}
*END
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, JUSTIFY=RIGHT, $
TYPE=HEADING, LINE=2, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=NORMAL, COLOR=RGB(255 128 0), $
type=report, column=CAR.BODY.RETAIL_COST, bucket=size, $
type=report, column=CAR.BODY.DEALER_COST, bucket=color, $
type=report, column=CAR.COMP.CAR, bucket=detail, $
ENDSTYLE
END


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 188 | Registered: October 19, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks for the sample code, not exactly what I want but close, I think I can play around to get what I need. Thanks!


WebFOCUS v8.2.06 , Windows
 
Posts: 124 | Registered: August 29, 2019Reply With QuoteReport This Post
Platinum Member
posted Hide Post
quote:
Thanks for the sample code, not exactly what I want but close

Yes, if you come up with something I would be interested in what you find.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 188 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]how to set specific value range in treemap's color scale?

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