KoolReport's Forum

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

Panels with PivotMatrix on Dashboards not working #2073

Closed Christian Voß opened this topic on on May 12, 2021 - 7 comments

Christian Voß commented on May 12, 2021

Hi,

I have another problem with the dashboard platform. It seems that the panels are not working correctly. I.e. I have this in the widget function of my dashboard:

Panel::create()->header("Income Chart")->type("primary")->sub([
             KWidget::create()
                ->use(PivotMatrix::create([
                    'title' => 'Test',
                    "dataStore"=>(new SLCMainMatrix)->dataStore('slc_compl_data'),
                    'template' => 'PivotMatrix-Bun',
                    'rowCollapseLevels' => array(0),
                    'columnCollapseLevels' => array(0, 1, 2),
                    'columnWidth' => '10px',
                    'hideTotalColumn' => true,
            
                     'dataMap' => function($v, $f) {
                         
                         return sprintf("%.2f%%", $v * 100);
                        },
                    'headerMap' => function($v, $f) {

                    if ($f === 'date') return Carbon::parse($v)->format(env("DATE_FORMAT"));
                        return $v;
                    }, 
                    
                    'cssClass' => [
                      
                        'dataCell' => function($value, $cellInfo) {
                            if ($value >= 0.934) {
                                return 'bg-success text-dark';
                            } elseif ($value >=0.879) {
                                return 'bg-warning text-dark';
                            } else {
                                return 'bg-danger text-dark';
                            }
                            
                        },
                    ],

                ])
                )
           ])

However, the Pivot table isn't shown inside the panel. Instead I get an empty panel below the pivot table.

Any help would be appreciated.

Thanks

Christian

Christian Voß commented on May 12, 2021

Ok, it seems that this is an issue with the KWidget or with the Pivot. As it seems to work for other widget. However, a quick fix would still be very welcome.

Thanks

Christian

Sebastian Morales commented on May 12, 2021

Pls replace PivotMatrix with PivotTable and see if it works. We will make sure PivotMatrix works better with Dashboard in the next version release. Tks,

Christian Voß commented on May 12, 2021

Hi Sebastian,

I just tried that, but it shows exactly the same behaviour.

Is there anything else I can do?

Best regards

Christian

Sebastian Morales commented on May 12, 2021

Can you pls confirm the PivotMatrix's or PivotTable's datastore:

(new SLCMainMatrix)->dataStore('slc_compl_data')

is the result of a Pivot process?

Christian Voß commented on May 12, 2021

Hi Sebastian, yes it is.

The table itself is rendered correctly, just not inside the panel. The panel is displayed below the pivot table (or matrix).

Sebastian Morales commented on May 12, 2021

Christian, pls check our Dashboard example for KWidget including a PivotTable:

https://www.koolreport.com/dashboard/demo/#KWidgetsBoard

Pls try to copy and modify it to see if it works for your case. Rgds,

Christian Voß commented on May 14, 2021

Hi Sebastian,,

thank you very much. This fixed everything. Apparently I had a structural error somewhere. Still don't know why it wasn't working, but I recreated everything from scratch based on the demo and now its working very well.

Thanks :)

Christian

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
bug

Dashboard