KoolReport's Forum

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

D3 funnel chart not fixed height #1401

Open ankit raj opened this topic on on Apr 21, 2020 - 3 comments

ankit raj commented on Apr 21, 2020

Hello , i am using d3 funnel chart but when i ajax refresh with different values , the height goes for a toss.Is there a way to keep the height same as the right image irrespective of values. Right is the default height and left is the refreshed height: This is the option i am using:

 \koolreport\d3\FunnelChart::create([
                        "dataSource"=>array(
                            array("category"=>"Total ICF Sent","amount"=>$feedback),
                            array("category"=>"Received","amount"=>$recieved)
                        ),

                        "columns"=>[
                            "category",
                            "amount"
                        ],
                     
                        "chart"=>array(
                            "bottomWidth"=>0.4,
                        ),
                        "clientEvents"=>array(
                            "itemSelect"=>"function(data){
                                console.log(data);
                            }"
                        )
                    ],true);
KoolReport commented on Apr 22, 2020

May I know if you load the chart in left image straightly (not via ajax), does it show correctly? (just to know whether because of ajax).

Second, how did you update the FunnelChart via ajax. May you show me a little code.

ankit raj commented on Apr 22, 2020

Hey yes if i load it directly with the same values in the left directly with hard coded values ,i get the correct height but in ajax , i render my complete page through html , and so the parameter true is used. i just copy this in my complete html string.

KoolReport commented on Apr 23, 2020

Please try to set the height to see how:

FunnelChart::create([
    "height"=>"500px"
]);

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