Skip to content

Commit

Permalink
Fix-254: Autosize radial and pie charts.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette committed May 7, 2023
1 parent 84ce04a commit 8be8b3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.3.5] 2023-01-31 (dev)
## [2.3.5] 2023-05-07
### Updated
- Partial fix for sizing issue of radial and pie charts in Moodle 4.1 and 4.2.
- Copyright notice to include 2023.

## [2.3.4] 2022-12-11
Expand Down
4 changes: 2 additions & 2 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3363,7 +3363,7 @@ function ($matches) use($mycohorts) {
if ($CFG->branch >= 39) {
$chart->set_legend_options(['display' => false]); // Hide chart legend.
}
$html = $OUTPUT->render_chart($chart, false);
$html = '<div class="fc-chart-pie">' . $OUTPUT->render_chart($chart, false) . '</div>';
break;
case 'pie': // Tag: {chart pie 99 Label to be displayed} - Display a pie chart.
$chart = new \core\chart_pie();
Expand All @@ -3377,7 +3377,7 @@ function ($matches) use($mycohorts) {
if ($CFG->branch >= 39) {
$chart->set_legend_options(['display' => false]); // Hide chart legend.
}
$html = $OUTPUT->render_chart($chart, false);
$html = '<div class="fc-chart-pie">' . $OUTPUT->render_chart($chart, false) . '</div>';
break;
case 'progressbar': // Tag: {chart progressbar 99 Label to be displayed} - Display a horizontal progres bar.
$html = '
Expand Down
3 changes: 3 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.fc-chart-pie .chart-area .chart-image {
width: auto;
}

0 comments on commit 8be8b3b

Please sign in to comment.