Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68477

Charts API: support for legend options for Chart.js

XMLWordPrintable

      This patch branch provides a means to set legend options as per: https://www.chartjs.org/docs/2.7.0/configuration/legend.html

      It adds a field, setters and getters to the Base chart classes in PHP and Javascript. From Moodle, it is invoked via e.g.: $chart->set_legend_options(array('position' => 'bottom', 'reverse' => true))

      At this point, specifying onClick and onHover events is not directly supported via this method. Dynamically creating functions out of strings is not permitted by the ESLint no-new-func directive, and it's arguable as to whether that would be a good approach to take in the first place.

            drcuriosity David Thompson
            drcuriosity David Thompson
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 25 minutes
                2h 25m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.