Charts in Moodle Mobile

Re: Charts in Moodle Mobile

by Dani Palou -
Number of replies: 1
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi,

the Moodle app also has the ChartJS library, it is used in a couple of places like in the choice activity. We developed an Angular component to easily use it, in here you can see how it is used in the choice activity.

In this file you'll see the implementation of that component.

Basically you need to supply:

  • The type of chart (pie, doughnut, ...).
  • An array with each value to display in the chart.
  • An array with the labels (text) for each value.

There are other configuration parameters, but I think those are the required ones to make it work.

Cheers,

Dani