KoolReport's Forum

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

Drilldown Stacked #3173

Open Adolfo Alonso opened this topic on on Oct 17, 2023 - 5 comments

Adolfo Alonso commented on Oct 17, 2023

Hello, is it possible to do a Stacked Drilldown report?

Sebastian Morales commented on Oct 18, 2023

Did you mean DrillDown to work with stacked column/bar chart or something else?

Adolfo Alonso commented on Oct 18, 2023

Yes, drill down with stacked columns

Sebastian Morales commented on Oct 19, 2023

You can use the following example for Drilldown with stacked column chart:

https://www.koolreport.com/examples/reports/drilldown/drilldown/

Change the single series column chart to a multi-series stacked one and replace the following drill down command:

            saleDrillDown.next({year:params.selectedRow[0]});

to using your column name, row value, etc. You can show value structure of params with this to know how to get needed parameters:

            // saleDrillDown.next({year:params.selectedRow[0]});
            console.log("params:", params);
Adolfo Alonso commented on Oct 20, 2023

Hi Sebastian, do you have more information on chaing the single series column chart to a multi-series stacked one?

Sebastian Morales commented on Oct 23, 2023

Here's an example of multi-column ColumnChart in DrillDown:

                    ColumnChart::create(array(
                        ...
                        "columns"=>array(
                            "year"=>array(...),
                            "sale_amount"=>array(...),
                            "sale_amount2"=>array(...),
                        ), 
                        "clientEvents"=>array(
                            "itemSelect"=>"function(params){
                                console.log('params: ', JSON.stringify(params, null, 2));
                            }",
                        ),

And here's the params when a column is clicked:

{
  "selectedRowIndex": 0,
  "selectedColumnIndex": 2,
  "selectedValue": 6500435.400000001,
  "selectedRow": [
    "2003",
    3250217.7000000007,
    6500435.400000001
  ],
  "columnName": "Sale Amount 2",
  ...
}

Based on this you can pass the column name, index, or value to the next chart/table in DrillDown.

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

None