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

Charts API: support for legend options for Chart.js

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              drcuriosity David Thompson
              Reporter:
              drcuriosity David Thompson
              Peer reviewer:
              Simey Lameze
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

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