Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report 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 versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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

Copyright © 1996-2020 Information Builders