June 2017
Beginner to intermediate
368 pages
8h 31m
English
To display a chart, we first need to provide an HTML canvas element upon which the chart will be drawn. We can add the following line to the block's get_content() function:
$this->content->text .= html_writer::empty_tag('canvas', array('id'=>'myChart'));
Now, back in chart_renderer.js, we begin by storing the different user configurable colors that represent the various completion statuses:
var col_complete = completion_data.colors.completed_colour; var col_incomplete = completion_data.colors.notCompleted_colour; var col_submitted = completion_data.colors.submittednotcomplete_colour; var col_failed = completion_data.colors.futureNotCompleted_colour;
Then we establish three arrays to store the status color, the mouse hover ...
Read now
Unlock full access