diff options
author | msquare <msquare@notrademark.de> | 2018-12-09 13:07:19 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-12-09 13:07:19 +0100 |
commit | 412be8e1884eab7d543c26fafcc93fca3eca8cd1 (patch) | |
tree | c3e914edc3a6ace530da26d7e87e5fcf481d1239 /includes | |
parent | 93b819025c833eaaec730007ad3953c1e8c27768 (diff) |
upgrade chart.js lib and fix bargraph. fixes #511
Diffstat (limited to 'includes')
-rw-r--r-- | includes/helper/graph_helper.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/helper/graph_helper.php b/includes/helper/graph_helper.php index f49ab635..7c6e6114 100644 --- a/includes/helper/graph_helper.php +++ b/includes/helper/graph_helper.php @@ -25,7 +25,7 @@ function bargraph($dom_id, $key, $row_names, $colors, $data) } $datasets[] = [ 'label' => $name, - 'fillColor' => $colors[$row_key], + 'backgroundColor' => $colors[$row_key], 'data' => $values ]; } @@ -34,9 +34,12 @@ function bargraph($dom_id, $key, $row_names, $colors, $data) <script type="text/javascript"> $(function(){ var ctx = $(\'#' . $dom_id . '\').get(0).getContext(\'2d\'); - var chart = new Chart(ctx).Bar(' . json_encode([ - 'labels' => $labels, - 'datasets' => $datasets + var chart = new Chart(ctx, ' . json_encode([ + 'type' => 'bar', + 'data' => [ + 'labels' => $labels, + 'datasets' => $datasets + ] ]) . '); }); </script>'; |