Ok, here it is.
Category class:
class AcceptTopZerado extends Category
{
protected function onDataReady($result)
{
echo $result['data']->toJson();exit;
}
protected function onInit()
{
$this
->title('Top '. Lang::t('Valueless'))
->type('success')
->lazyLoading(true);
}
protected function dataSource()
{
return $this->dashboard()->getDataG('queryAvbAceitacaoMes', $this->params)
->run(); // <-- With and without this one
}
protected function fields()
{
return [
$this->group(Text::create('vlr0'))->showTop(5)->andShowOthers(Lang::t('Others')),
$this->sum(
Number::create('qtd_avb')->suffix('')->decimals(0)->decimalPoint(Lang::t('.'))->thousandSeparator(Lang::t(','))
)->showRawValue(true)->suffix('')->decimals(0)->decimalPoint(Lang::t('.'))->thousandSeparator(Lang::t(','))
];
}
}
Result without run() - chart plot ok:
[
{
"vlr0": "Doc Cancelado",
"qtd_avb_sum": "1012"
},
{
"vlr0": "Modalidade do Frete",
"qtd_avb_sum": "76"
},
{
"vlr0": "Tipo do Doc",
"qtd_avb_sum": "1127"
},
{
"vlr0": "Tipo do Serviço",
"qtd_avb_sum": "805"
},
{
"vlr0": "Transportador Incluído",
"qtd_avb_sum": "948"
},
{
"vlr0": "Valor Integral",
"qtd_avb_sum": "94710"
}
]
Result with run() - chart plot broken:
[
{
"qtd_seg": "2",
"ramo": "654",
"doc": "CT-e",
"serie": "001",
"subs": "0",
"flags": "SNNNNNNNNC",
"aceito": "Aceito",
"vlr0": "Doc Cancelado",
"qtd_avb": "7",
"val_avb": "0.00",
"val_benef_int": "0.00",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 1012
},
{
"qtd_seg": "1",
"ramo": "621",
"doc": "NF-e",
"serie": "001",
"subs": "0",
"flags": "SNNNNNNNNF",
"aceito": "Aceito",
"vlr0": "Modalidade do Frete",
"qtd_avb": "1",
"val_avb": "0.00",
"val_benef_int": "0.00",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 76
},
{
"qtd_seg": "1",
"ramo": "654",
"doc": "CT-e",
"serie": "001",
"subs": "0",
"flags": "SNNNNNNNNT",
"aceito": "Aceito",
"vlr0": "Tipo do Doc",
"qtd_avb": "3",
"val_avb": "0.00",
"val_benef_int": "0.00",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 1127
},
{
"qtd_seg": "1",
"ramo": "654",
"doc": "CT-e",
"serie": "001",
"subs": "0",
"flags": "SNSNNNNNNS",
"aceito": "Aceito",
"vlr0": "Tipo do Serviço",
"qtd_avb": "11",
"val_avb": "0.00",
"val_benef_int": "0.00",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 805
},
{
"qtd_seg": "1",
"ramo": "621",
"doc": "NF-e",
"serie": "001",
"subs": "0",
"flags": "SNNNNNNNNI",
"aceito": "Aceito",
"vlr0": "Transportador Incluído",
"qtd_avb": "1",
"val_avb": "0.00",
"val_benef_int": "0.00",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 948
},
{
"qtd_seg": "2",
"ramo": "654",
"doc": "CT-e",
"serie": "001",
"subs": "0",
"flags": "SNNNNNNNNN",
"aceito": "Aceito",
"vlr0": "Valor Integral",
"qtd_avb": "540",
"val_avb": "93097842.92",
"val_benef_int": "4087116.68",
"val_benef": "0.00",
"val_despesas": "0.00",
"qtd_falha": "0",
"val_acima_lr": "0.00",
"qtd_emb_acima_lr": "0",
"dt": "2021-01-01 00:00:00",
"ano": "2021",
"qtd_avb_sum": 94710
}
]