A waterfall chart is a form of data visualization that helps in understanding the cumulative effect of sequentially introduced positive or negative values. These intermediate values can either be time based or category based. The waterfall chart is also known as a flying bricks chart or Mario chart due to the apparent suspension of columns (bricks) in mid-air. Often in finance, it will be referred to as a bridge.
<?php
require_once "../../../load.koolreport.php";
require_once "MyReport.php";
$report = new MyReport;
$report->run()->render();
<?php
class MyReport extends \koolreport\KoolReport
{
}
<?php
use \koolreport\d3\Waterfall;
?>
<div class="report-content" title="">
<div class="text-center">
<h1>Waterfall</h1>
<p class="lead">
This example shows how to draw beautiful Waterfall
</p>
</div>
<div style="margin-bottom:50px;">
<?php
Waterfall::create([
"title"=>"Profit path",
"dataSource"=>[
["name"=>"Product Revenue","amount"=>420000],
["name"=>"Services Revenue","amount"=>210000],
["name"=>"Fixed Costs","amount"=>-170000],
["name"=>"Variable Costs","amount"=>-140000],
],
"columns"=>[
"name",
"amount"=>[
"format"=>"function(d){
return `\${Math.round(d / 1000)}k`;
}"
]
],
"yAxis"=>[
"prefix"=>"$",
],
"summary"=>[
"Total Revenue"=>2,
"Profit"=>"end"
],
]);
?>
</div>
</div>