Skip to main content

Moodle Charts

Description

The core chart_builder interface for the ChartJS library that allows you to create a nice visual presentation of your data.

Source files

  • lib/amd/src/chart_builder.js
  • lib/amd/src/chart_*.js
  • lib/templates/chart.mustache

Core api

Create a new instance of your required chart type

<?php 
  $chart1 = new chart_bar();
  $series1 = new chart_series('Data type', $data);
  $chart1->add_series($series1);
  $OUTPUT->render($chart1);
 ?>

JavaScript

core/chart
core/chart
core/chart
core/chart
core/chart
core/chart
core/chart
core/chart