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

Allow chart colours to be customised site-wide.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Administration, Themes
    • Labels:
    • Testing Instructions:
      Hide
      1. Visit Chart.js test page: http://YOURHOSTNAMEHERE/stable_master/lib/tests/other/chartjstestpage.php.
      2. Make sure charts are displayed correctly and the colours are the same with/without the patch.
      3. Open you config.php and add the following line:

        $CFG->chart_colorset = ['#001f3f', '#01FF70', '#F012BE', '#85144b', '#7FDBFF', '#c29980', '#755d0d', '#009956', '#B10DC9', '#004565'];

      4. VIsit Chart.js test page again, make sure the colours defined on config are applied to ALL charts.
      Show
      Visit Chart.js test page: http://YOURHOSTNAMEHERE/stable_master/lib/tests/other/chartjstestpage.php . Make sure charts are displayed correctly and the colours are the same with/without the patch. Open you config.php and add the following line: $CFG->chart_colorset = ['#001f3f', '#01FF70', '#F012BE', '#85144b', '#7FDBFF', '#c29980', '#755d0d', '#009956', '#B10DC9', '#004565']; VIsit Chart.js test page again, make sure the colours defined on config are applied to ALL charts.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57194-master

      Description

      Following on from MDL-55037 to define some default graph colours, which I totally agree with, it would be good if there was a way for an admin to change those default colours somehow, perhaps to work better with a theme.

      For now the minimum might be to just allow a CFG array variable to be inserted in config.php, which if defined, would override the default colour list.

      So at least it's possible in 3.2. UI not necessary.

      On the other hand perhaps there is a better way already in which case please let me know.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16