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)
Reviewed: https:/ /reviews. mahara. org/9000 /git.mahara. org/mahara/ mahara/ commit/ 7b9303eb875ed46 b8f9d32c80aac03 2ef30d88b2
Committed: https:/
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 17.10_STABLE
commit 7b9303eb875ed46 b8f9d32c80aac03 2ef30d88b2
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' PolarArea/ Pie use segments
or 'segments' depending on the type of charts
type Doughnut/
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: Id3ef35a5037ac2 c30d342279e0af7 052584f7d16 0f8336a5f556387 67f9607f87) a2bb398635b1cd0 b04521b101)
(cherry picked from commit d09994c2b7df4a3
(cherry picked from commit c07156122d6dc32