KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Having issues with waterfall chart #1248

Open sajid opened this topic on on Jan 8, 2020 - 2 comments

sajid commented on Jan 8, 2020

Hello Koolreport team my SP returns the following data set

My datasource code is as follows

 $this->src('db')
            ->query("EXEC rp_get_test @invtId = :invtId, @entryDateEnd = :EndDate")
            ->params(array(
                "invtId" => $invtId,
                "EndDate" => $endDate,
            ))
            ->pipe($this->dataStore("NAVNEW"));

Note: I am able to render a basic table to verify the data

My view code is as follows

use \koolreport\d3\Waterfall;

Waterfall::create([
                                    "dataSource" => $this->dataStore('NAVNEW'),
                                    "columns" => [
                                        "entryType",
                                        "amt" => [
                                            "format" => "function(d){
                                                return `\${Math.round(d / 1000000)}M`;
                                            }"
                                        ]
                                    ],
                                    "yAxis" => [
                                        "prefix" => "$",
                                    ]
                                ]);

Rendered waterfall graph

Am I missing something here? Please help

KoolReport commented on Jan 9, 2020

Hi,

I have come up with a fix, could you please go to line 113 of \koolreport\d3\Waterfall.php and change this line:

"value"=>$row[$cKeys[1]],

to

"value"=>(float)$row[$cKeys[1]],

Let us know if it works.

sajid commented on Jan 9, 2020

it works!!! Thank you so much...

On a separate note, I am using this chart for financial reports. usually, the first column represents the starting/carryover amounts, Is there a way to customize the color for the first column only?

Regards Sajid

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

D3