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] Waterfall Chart Style Question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Waterfall Chart Style Question
 Login/Join
 
Master
posted
Hello

I am working on waterfall chart and having couple of issues. I mimicked with CAR file.
1. I am trying to remove black line that is connecting the bars
2. I am trying to get positive bars with 1 color and -ve bars with another color

DEFINE FILE CAR
LOSS/I8 = -4500;
END

GRAPH FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
	LOSS
	SALES
ON GRAPH SET LOOKGRAPH VWATERFL
ON GRAPH SET BARNUMB ON
ON GRAPH SET VAXIS 500
ON GRAPH SET HAXIS 600
ON GRAPH SET VZERO ON
ON GRAPH SET GRAPHSTYLE *
setStackedDataValueSum(false);
setPlace(true);
setDepthRadius(0);
setDepthAngle(0);
setTransparentBorderColor(getChartBackground(),true);
setTransparentFillColor(getFrame(),true);
setWaterfallGroupMode(8,3);
setDisplay(getY1MajorGrid(),false);
setDisplay(getO1MajorGrid(),false);
setPlaceRotate(getO1Title(),0);
setTextRotation(getO1Label(),0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 11);
setPlaceResize(getO1Label(), 0);
setFontSizeAbsolute(getY1Label(), true);
setFontSizeInPoints(getY1Label(), 12);
setPlaceResize(getY1Label(), 0);
setFontStyle(getDataText(),0);
setFontStyle(getY1Label(),0);
setFontStyle(getO1Label(),0);
setBorderColor(getO1AxisLine(),new Color(255,255,255));
setBorderColor(getY1ZeroLine(),new Color(255,255,255));
setFillColor(getY1ZeroLine(),new Color(255,255,255));
setBorderColor(getY1AxisLine(),new Color(255,255,255));
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getDataText(), true);
setFontSizeInPoints(getDataText(), 12);
setPlaceResize(getDataText(), 0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setTextRotation(getO1Label(),1);
ENDSTYLE
END



Please suggest.

Thank you

This message has been edited. Last edited by: <Kathryn Henning>,


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Master
posted Hide Post
To remove connecting lines, add below set command.

setDisplay(getWaterfallLine(), false);

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Master
posted Hide Post
Try below code. I am able to highlight loss column, but without datatext display.
[CODE]

APP PATH IBISAMP
-RUN

DEFINE FILE CAR
LOSS/I8 = -1500;
DUMMY_A/I1= IF COUNTR EQ 'ENGLAND' THEN 1 ELSE IF COUNTRY EQ 'FRANCE' THEN 2 ELSE IF COUNTRY EQ 'ITALY' THEN 3 ELSE 4;
XAXIS_LABEL/A20= IF COUNTR EQ 'ENGLAND' THEN 'DEALER_COST' ELSE IF COUNTRY EQ 'FRANCE' THEN 'RETAIL_COST' ELSE IF COUNTRY EQ 'ITALY' THEN 'LOSS' ELSE 'SALES';
MEASURE_A/D20.2 MISSING ON=IF COUNTR EQ 'ENGLAND' THEN DEALER_COST ELSE IF COUNTRY EQ 'FRANCE' THEN RETAIL_COST ELSE IF COUNTRY EQ 'ITALY' THEN MISSING ELSE RETAIL_COST;
MEASURE_B/D20.2 MISSING ON=IF COUNTRY EQ 'ITALY' THEN LOSS ELSE MISSING;
END

GRAPH FILE CAR
SUM
MEASURE_A AS ''
MEASURE_B AS ''
BY DUMMY_A NOPRINT
BY XAXIS_LABEL AS ''
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE' OR 'ITALY' OR 'JAPAN';
ON GRAPH SET LOOKGRAPH VWATERFL
ON GRAPH SET BARNUMB ON
ON GRAPH SET VAXIS 500
ON GRAPH SET HAXIS 600
ON GRAPH SET VZERO ON
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
setStackedDataValueSum(false);
setPlace(true);
setDepthRadius(0);
setDepthAngle(0);
setTransparentBorderColor(getChartBackground(),true);
setTransparentFillColor(getFrame(),true);
setWaterfallGroupMode(8,3);
setDisplay(getY1MajorGrid(),false);
setDisplay(getO1MajorGrid(),false);
setPlaceRotate(getO1Title(),0);
setTextRotation(getO1Label(),0);
setFontSizeAbsolute(getO1Label(), true);
setFontSizeInPoints(getO1Label(), 11);
setPlaceResize(getO1Label(), 0);
setFontSizeAbsolute(getY1Label(), true);
setFontSizeInPoints(getY1Label(), 12);
setPlaceResize(getY1Label(), 0);
setFontStyle(getDataText(),0);
setFontStyle(getY1Label(),0);
setFontStyle(getO1Label(),0);
setBorderColor(getO1AxisLine(),new Color(255,255,255));
setBorderColor(getY1ZeroLine(),new Color(255,255,255));
setFillColor(getY1ZeroLine(),new Color(255,255,255));
setBorderColor(getY1AxisLine(),new Color(255,255,255));
setDisplay(getLegendArea(),false);
setFontSizeAbsolute(getDataText(), true);
setFontSizeInPoints(getDataText(), 12);
setPlaceResize(getDataText(), 0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setTextRotation(getO1Label(),1);
setDisplay(getWaterfallLine(), false);
setDisplay(getDataText(), false);
setFillColor(getSeries(0),new Color(0,128,0));
setFillColor(getSeries(1),new Color(255,0,0));
TYPE=DATA, COLUMN=MEASURE_A, COLOR=RED, WHEN = MEASURE_A LE 10000, $
ENDSTYLE
END


[CODE]

Looks like enabling conditional color for bars in waterfall chart is a challenge.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
<nick z>
posted
Hi Enigma006,
If you want to display positive numbers green and -ve numbers red, add
setWaterfallStackColorMode(true);
to your procedure.

And as Ram already pointed out add
setDisplay(getWaterfallLine(), false);
if you want to remove the connecting waterfall lines.

Thank you.
Nick.
 
Report This Post
Master
posted Hide Post
Thanks Ram. This worked
quote:
Originally posted by Ram Prasad E:
To remove connecting lines, add below set command.

setDisplay(getWaterfallLine(), false);

Thanks,
Ram


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Master
posted Hide Post
quote:
Originally posted by nick z:
Hi Enigma006,
If you want to display positive numbers green and -ve numbers red, add
setWaterfallStackColorMode(true);
to your procedure.

And as Ram already pointed out add
setDisplay(getWaterfallLine(), false);
if you want to remove the connecting waterfall lines.

Thank you.
Nick.


Thanks Nick, I am getting green and red colors.
But can I customize to provide my own color for both positive and negative value?


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
<nick z>
posted
You can't do it in the old Graph engine.
And no New Features are being accepted.

But if you move to WF8.x you will be able to use JSCHART Graph engine.

Here is a sample code that would work in JSCHART output format:


DEFINE FILE CAR
LOSS/I8 = -4500;
END

GRAPH FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
	LOSS
	SALES
ON GRAPH SET LOOKGRAPH VWATERFL
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET BARNUMB ON
ON GRAPH SET VAXIS 500
ON GRAPH SET HAXIS 600
ON GRAPH SET VZERO ON
ON GRAPH SET STYLE *

*GRAPH_JS
legend: {visible:false},
waterfallProperties: {
appendTotalRiser: true,
positiveRiserColor: 'blue',
negativeRiserColor: 'yellow',
connectorLine: {
width: 0,
}

}
*END
ENDSTYLE
END

 
Report This Post
Master
posted Hide Post
Thanks Nick for sharing.

I tried conditional coloring for bars using Java methods. But unable to make it.

As Nick suggested, you can only control bar colors(positive, negative) using javascript styling.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
<nick z>
posted
Hi Ram,
I looked at your code and it was a very nice try. However, your LOSS column is not actually a "Loss". If you look closely at your output, the LOSS column is going up. It should have been going down since it's a loss.
And that is because in your stack, you have a mix of Positive(actually missing, but waterfall turns missing into 0) and negative. And Waterfall always turns the sign into whatever the first value is. So it turned your sum into positive. To fix it, just switch the order of your measures:

SUM
MEASURE_B AS ''
MEASURE_A AS ''

And change the colors of course, or your positive values would be in red and negative in green:

setFillColor(getSeries(1),new Color(0,128,0));
setFillColor(getSeries(0),new Color(255,0,0));

Hope this helps.

As for conditional styling, you actually can do it, but you will need a SORT field.

So here is the code that would work in the old graph engine with conditional styling:

GRAPH FILE CAR
SUM COMPUTE NewSALES/D12.2=IF COUNTRY EQ 'ITALY' THEN SALES*-1 ELSE SALES;
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VWATERFL
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
*GRAPH_SCRIPT
setFillColor(getSeries(0),new Color(0,128,0));
setDisplay(getWaterfallLine(), false);
setColorMode(1);
*END
DEFMACRO=Condition_1, MACTYPE=RULE, WHEN=N2 LT 0, $
TYPE=DATA, COLUMN=N2, MACRO=Condition_1, COLOR=RGB(255 0 0), $
ENDSTYLE
END



Thanks.
Nick.
 
Report 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] Waterfall Chart Style Question

Copyright © 1996-2020 Information Builders