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.
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