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] Spectral graph (pdf) change color scale
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Spectral graph (pdf) change color scale
 Login/Join
 
Silver Member
posted
I'm trying to change the color scale in a spectral graph. I've tried to use the colorscale property from the documentation but that only works when the format is JSCHART. I've also tried changing the color via labels, that also doesn't work. Does anyone have advice for how to do this?
Here is an example using the car file:
 ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='4.21875';
-DEFAULTH &WF_STYLE_WIDTH='8.020833';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM AVE.CAR.BODY.DEALER_COST
BY CAR.SPECS.MPG
ACROSS CAR.SPECS.WEIGHT
ON GRAPH PCHOLD FORMAT PDF
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 GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH SPECTRAL
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setDataTextPosition(4);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Flat.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
-*Tried this to change the colors in the spectral chart
-*TYPE=DATA, COLUMN=DEALER_COST, BACKCOLOR=PINK, WHEN=DEALER_COST LE 8000, $

*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
-*Tried this to change the colors in a spectral chart
-*"colorScale": {"colors": ["tan", "antiquewhite"]}
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH
 

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


WebFOCUS 8.1.05M AppStudio, 8202M AppStudio
Windows, All Outputs
 
Posts: 39 | Registered: March 21, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Many JSCHART features are not rendered the same within PDF format which can possibly be explained with this similar issue
[SOLVED] Waterfall Charts output differences
or look at Tony's reply in this post
Dynamic Bands in Gauge Chart - Format GIF or PNG


WF 7.7.05M, 8.1.05M, 8.2.0.1M gen240 Windows, HTML, Excel, PDF
In Focus since 2007
 
Posts: 1800 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thanks MartinY! Those posts led me to opening a case and with tech support help I was able to come to a solution that worked for me.
You are right there is an older engine used for PDF charts. You can use getColorByHeight and gradient pins to set up a color scale for spectral maps in this engine. Here is the styling code that gave me the color scale and order that I was looking for.
 setGradientNumPins(getColorByHeight(),2);
setGradientPinPosition(getColorByHeight(),0.0,0);
setGradientPinLeftColor(getColorByHeight(),new Color(255,255,255),0);
setGradientPinRightColor(getColorByHeight(),new Color(255,255,255),0);
setGradientPinPosition(getColorByHeight(),1.0,1);
setGradientPinLeftColor(getColorByHeight(),new Color(0,0,255),1);
setGradientPinRightColor(getColorByHeight(),new Color(0,0,255),1);
 


Once I did that my borders were still odd colors and needed some help. I did the following to make the borders all black:
setSeriesBorderColor(1,new Color(0,0,0));
setSeriesBorderColor(2,new Color(0,0,0));
setSeriesBorderColor(3,new Color(0,0,0));
setSeriesBorderColor(4,new Color(0,0,0));
setSeriesBorderColor(5,new Color(0,0,0));
setSeriesBorderColor(0,new Color(0,0,0));  

This worked for my current needs and I hope it ends up being dynamic enough in the future.


WebFOCUS 8.1.05M AppStudio, 8202M AppStudio
Windows, All Outputs
 
Posts: 39 | Registered: March 21, 2014Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Spectral graph (pdf) change color scale

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