Focal Point
[SOLVED] last bar to be displayed full

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4167078776

August 17, 2015, 05:01 AM
Satya Dach
[SOLVED] last bar to be displayed full
Hi,

I have code like below
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: false,
positiveRiserColor: 'blue',
negativeRiserColor: 'yellow',
connectorLine: {
width: 0,
}

}
*END
ENDSTYLE
END

where the last bar "SALES" need to be displayed from the axis - 0 and also I need to change the title from SALES to any other title how to achieve this using waterfall chart

This message has been edited. Last edited by: <Kathryn Henning>,
August 18, 2015, 07:33 AM
<nick z>
Hi Satya,
Yes,
You can add:
  subtotalRisers: [3], 

to your waterfall property.
If you want to change the color of this subtotal riser to match your positive riser colors you would also need to add:
 zeroRiserColor: 'blue', 


And you can change SALES to display anything you like by using AS 'name' for example:
SUM SALES AS 'TOTAL_SALES'

Here is a complete example:

  
DEFINE FILE CAR
LOSS/I8 = -4500;
END

GRAPH FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
	LOSS
	SALES AS 'TOTAL_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: false,
positiveRiserColor: 'blue',
negativeRiserColor: 'yellow',
subtotalRisers: [3],  
zeroRiserColor: 'blue',
connectorLine: {
width: 0,
}

}
*END
ENDSTYLE
END





However,
I would recommend a slightly different approach.
Instead of using subtotalRisers, I would instead turn appendTotalRiser to true and remove SALES from your request.
You can then change the name of the Total to anything you like with:
totalLabel: 'Total_Sales',

Here is a complete code:

 
DEFINE FILE CAR
LOSS/I8 = -4500;
END

GRAPH FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
	LOSS
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',
zeroRiserColor: 'blue',
totalLabel: 'Total_Sales',
connectorLine: {
width: 0,
}

}
*END
ENDSTYLE
END



Thanks.
Nick.
August 24, 2015, 07:33 AM
Satya Dach
thanks for the reply, for PNG out put how to achieve
below functionalities

positiveRiserColor: 'blue',
negativeRiserColor: 'yellow',
zeroRiserColor: 'blue',

Please help

thanks
August 28, 2015, 04:47 AM
Satya Dach
There is no direct function for this, hence closed
August 30, 2015, 12:17 PM
<nick z>
You can achieve similar outcome in PNG. The only difference is that your positive risers will be green and negative will be red.
There is no way to change that in PNG format.
Here is a complete code example:

  
DEFINE FILE CAR
LOSS/I8 = -4500;
END

GRAPH FILE CAR
SUM
	DEALER_COST
	RETAIL_COST
	LOSS
COMPUTE	TOTAL_SALES/D12= (DEALER_COST+RETAIL_COST + LOSS); 
ON GRAPH SET LOOKGRAPH VWATERFL
ON GRAPH PCHOLD FORMAT PNG
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_SCRIPT
setDepthRadius(0);
setDepthAngle(0);
setPlace(true); 
setReportParsingErrors(false);
setSelectionEnableMove(false);
setWaterfallLastGroupTotal(true);
setWaterfallStackColorMode(true);
setStackedDataValueSum(false);
setDisplay(getWaterfallLine(), false);
setDataTextDisplay(true);
setDisplay(getLegendArea(),false);
ENDSTYLE
END