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     Gauge Graph (Type 110) - Controlling the Green/Yellow/Red bands

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Gauge Graph (Type 110) - Controlling the Green/Yellow/Red bands
 Login/Join
 
Guru
posted
Hi Team,

I have a pretty good handle on hard-coding the Green/Yellow/Red "target" bands on the gauge graph. However, I am more interested in making these bands dynamic, based on data source fields.

For example, I want the needle to show yesterday's sales. The red band will start at zero (hardcoded) and then go to the sales for 1 year ago. The Green will start where the red stops and continue off the graph. I was also considering having yellow be some arbitrary amount between red and green.

The colour bands are controlled by the following commands:

setGaugeBandMin(getGaugeBand1(), 0);
setGaugeBandMax(getGaugeBand1(), 1000);

This example would start GaugeBand 1 at 0 and go to 1000.

I actually have a field that contains the SDLY Sales, so I tried this:

setGaugeBandMin(getGaugeBand1(), 0);
setGaugeBandMax(getGaugeBand1(), SALES_SDLY);

The output I get makes no sense, as Band 1 is red when I hardcode a number, but shows green when the field name is used. Furthermore, the value it is displaying is garbage; it starts at zero and goes to around 10 before stopping. This is the same behaviour that the chart defaults to before you edit the band ranges (red, yellow, green barely showing in the bottom left of the gauge).

I've tried populating variables with the -SET command to make them equal the SALES_SDLY field, and then putting the variable in the setGaugeBandMax field. Same strange behaviour. I know the variable passes correctly, since I can hardcode the variable's value in the set command and it behaves how it should. Seems like the graph just doesn't want me to use a field to control the bands.

Please help,

Joey

WF7.1, Tomcat on Linux, Informix on AIX
 
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005Report This Post
<JG>
posted
Joey,

I'm surprized that you got anything at all using a fieldname in the API code.

Take a look at the following example based on GGSALES.

SET HOLDLIST=PRINTONLY
DEFINE FILE GGSALES
YEAR/I4=EDIT(EDIT(EDIT(DATE),'9999'));
DOLLARSLY/I8=IF YEAR EQ 1996 THEN DOLLARS ELSE 0;
BUDDOLLARSLY/I8=IF YEAR EQ 1996 THEN BUDDOLLARS ELSE 0;
BUDDOLLARSTY/I8=IF YEAR EQ 1997 THEN BUDDOLLARS ELSE 0;
END
TABLE FILE GGSALES
SUM DOLLARSLY BUDDOLLARSLY BUDDOLLARSTY
BY REGION
WHERE YEAR EQ 1996 OR 1997
ON TABLE HOLD AS H1
END
-RUN

TABLE FILE H1
SUM AVE.DOLLARSLY NOPRINT
COMPUTE YELLOWMIN/I9= C1 * .8;
COMPUTE YELLOWMAX/I9= C1;
COMPUTE GREENMIN/I9=C1 * 1.1;
COMPUTE FULLD/D12.6=((AVE.BUDDOLLARSTY * 1.2)/1000000)+.5; NOPRINT
COMPUTE FULL/I9=INT(FULLD)*1000000;
ON TABLE HOLD AS VALUES FORMAT ALPHA
END
-RUN
-READ VALUES &YELLOWMIN.A9. &YELLOWMAX.A9. &GREENMIN.A9. &FULL.A9.
GRAPH FILE GGSALES
HEADING CENTER
"Regional Sales performance 1997 vs 1996"
SUM DOLLARS
ACROSS REGION
WHERE YEAR EQ 1997
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *

setScaleMaxAuto(false);
setScaleMax(getY1Axis(),&FULL.EVAL);

setGaugeBandMin(getGaugeBand1(), 0);
setGaugeBandMax(getGaugeBand1(), &YELLOWMIN.EVAL);
setGaugeBandMin(getGaugeBand2(), &YELLOWMIN.EVAL);
setGaugeBandMax(getGaugeBand2(), &YELLOWMAX.EVAL);
setGaugeBandMin(getGaugeBand3(), &YELLOWMAX.EVAL);
setGaugeBandMax(getGaugeBand3(), &GREENMIN.EVAL);
setGaugeBandMin(getGaugeBand4(), &GREENMIN.EVAL);
setGaugeBandMax(getGaugeBand4(), &FULL.EVAL);

setBorderColor(getGaugeBand1(),new Color(255,0,0));
setBorderColor(getGaugeBand2(),new Color(255,255,0));
setBorderColor(getGaugeBand3(),new Color(250,200,0));
setBorderColor(getGaugeBand4(),new Color(0,255,0));

setFillColor(getGaugeBand1(),new Color(255,0,0));
setFillColor(getGaugeBand2(),new Color(255,255,0));
setFillColor(getGaugeBand3(),new Color(250,200,0));
setFillColor(getGaugeBand4(),new Color(0,255,0));

setFontSizeAbsolute( getGaugeLabel(), true );
setFontSize( getGaugeLabel(), 9 );
setGaugeTitlePosition(3);
setSeriesLabel(0," ");
setPlace(false);
ENDSTYLE

END

JG
 
Report This Post
Guru
posted Hide Post
You are my new hero!

This code example worked perfectly, for which I thank you big big.

Joey


-WebFOCUS 8.2.01 on Windows
 
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005Report This Post
Platinum Member
posted Hide Post
HI JG
HOW CAN I CHANGE THE TICK VALUES FOR THIS .
AND I NEED TO TAKE THIS TICK VALUES FROM DATABASE.

THANKS
 
Posts: 155 | Location: Bangalore. | Registered: January 24, 2006Report This Post
Expert
posted Hide Post
Kalyanswarna,

Use the same principles that have been mentioned in reply to your previous posts.

i have some problems in my Gauge Chart

Hi I want to Pass Y Axis Values From The DataBase in Gauge Chart

Can i Call Y-axis Values From DataBase in A GRaph

You will find that we will all help when ever we can, but it helps if advice given is actually reused.

e.g. You can not help those that will not help themselves.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Hello - I have searched through the forum for 'Guage' topics. Can guage settings (like band definitions and label locations) be managed through the gui (report painter / graph assistant) ?
 
Posts: 38 | Registered: May 20, 2004Report 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     Gauge Graph (Type 110) - Controlling the Green/Yellow/Red bands

Copyright © 1996-2020 Information Builders