php-reports
php-reports copied to clipboard
Filter bar not working
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
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:
- 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
-- }
-- }