KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Waterfall chart #1068

Closed sajid opened this topic on on Aug 30, 2019 - 6 comments

sajid commented on Aug 30, 2019

Any sample for how to build a waterfall chart using KoolReport Pro?

KoolReport commented on Sep 2, 2019

Currently we have not had the waterfall chart. Do you currently use any kinds of javascript waterfall chart?

sajid commented on Sep 2, 2019

https://canvasjs.com/javascript-charts/waterfall-chart/

Eugene commented on Sep 3, 2019

+1

this type of chart is very popular in finance reports... it would be great if you add it to Kollreport package

KoolReport commented on Sep 6, 2019

Hi Sajid,

If you have the canvasjs waterfall chart then you need to connect data from dataStore of KoolReport to the dataPoints of Waterfall. Here are few step:

  1. Paste the script link to the canvasjs in the view of your report ( so that canvasjs can be loaded)
  2. Prepare the data for dataPoints. dataPoints is an array of object containing label and value so we will do this:
<?php
$dataPoints = array();
foreach($this->dataStore("yourstore") as $item)
{
    array_push($dataPoints,array(
        "label"=>$item["your-category-column-name"],
        "value"=>$item["your-value-column-name"]
    ));
}
?>

Now you have the the PHP array $dataPoints, In order to convert it into dataPoint of canvasjs, you will use the json_encode() function:

3 Create your waterfall like you normally do, and at the dataPoints settings, you do:

var chart = new CanvasJS.Chart("chartContainer", {
    ...
    data:{
        dataPoints:<?php echo json_encode($dataPoints); ?>
    }
    ...
}

All done! Hope that helps.

Eugene commented on Sep 6, 2019

Great, thank you

KoolReport commented on Oct 16, 2019

I would like to share our new D3 package with Waterfall chart.

KoolReport Is Free and Open-Source!

KoolReport is a professional php reporting framework which saves you tons of time to construct dynamic data report & dashboard.

  • Connect to various datasources such as MySQL, SQL Server, MongoDB or even from CSV or Excel file.
  • Contain series of powerful built-in data processes for your data manipulation.
  • Generate stunning charts and graphs to help you communicate data insights to your audiences effectively.
  • Integrate seamlessly with any php frameworks such as Laravel, CodeIgniter, Symfony.
Download Now and register our tutorials to get started!

Download KoolReport
help needed
solved
suggestion

None