php-reports icon indicating copy to clipboard operation
php-reports copied to clipboard

Filter bar not working

Open geo782 opened this issue 6 years ago • 1 comments

As title says, filter bar is not working, numbers in column are still there and no bar displayed. I checked code and : <div style="width: INFpx;" class="bar"></div> INFpx means its not getting value.

File is /classes/filters/barFilter.php

geo782 avatar Mar 28 '18 07:03 geo782

Well seems like this filter should be Dataset dependent and besides the $report->options['Values'] it uses is actually non-existent. A quick and dirty fix is:

  1. In classes/filters/barFilter.php replace
$width = round($max*($value->getValue()/max($report->options['Values'][$value->key])));

with

$width = round($max*($value->getValue()/max($report->options['DataSets'][$options['dataset']]['values'][$value->key])));

and then add to your params filter the dataset you want to apply the filter to... Like this:

-- FILTER: {
--   filter: "bar",
--   column: "Total",
--   dataset: 0,
--   params: {
--     "dataset": 0
--   }
-- }

PhobosK avatar May 24 '19 19:05 PhobosK