Comment 10 for bug 1778451

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9000
Committed: https://git.mahara.org/mahara/mahara/commit/7b9303eb875ed46b8f9d32c80aac032ef30d88b2
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 17.10_STABLE

commit 7b9303eb875ed46b8f9d32c80aac032ef30d88b2
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri Jun 29 13:01:33 2018 +1200

Bug 1778451: Show legend in charts

Use correct variable in template when creating the legend for charts.

In Chart.js legendTemplate uses var 'datasets'
or 'segments' depending on the type of charts
type Doughnut/PolarArea/Pie use segments
type Line/Radar/Bar use datasets

We have to check which one is defined in the Chart object before
modifying the legend template

Also delayed the updating of page by .5 secs so not to clash with
chart jsons stuff

behatnotneeded

Change-Id: Id3ef35a5037ac2c30d342279e0af7052584f7d16
(cherry picked from commit d09994c2b7df4a30f8336a5f55638767f9607f87)
(cherry picked from commit c07156122d6dc32a2bb398635b1cd0b04521b101)