You are here

README.txt in Charts 5.0.x

Installation using Composer (recommended)
========================================

If you use Composer to manage dependencies, edit "/composer.json" as follows.

    1. Add the asset-packagist composer repository to "composer.json". This allows
       installing packages (like Chart.js) that are published on NPM.

          "asset-packagist": {
              "type": "composer",
              "url": "https://asset-packagist.org"
          },

       You may need to add it in your composer.json file like this (second item in the array):

          "repositories": [
              {
                  "type": "composer",
                  "url": "https://packages.drupal.org/8"
              },
              {
                  "type": "composer",
                  "url": "https://asset-packagist.org"
              },
          ],

    2. Run "composer require --prefer-dist oomphinc/composer-installers-extender"
       to ensure that you have the "oomphinc/composer-installers-extender" package
       installed. This package facilitates the installation of any package into
       directories other than the default "/vendor" (e.g. "/libraries") using
       Composer.

    3. Configure composer to install the Chart.js dependencies into "/libraries"
       by adding the following "installer-types" and "installer-paths" to the "extra"
       section of "composer.json". If you are not using the "web" directory, then remove "web/" from the lines below:

       "extra": {
           "installer-types": ["npm-asset"],
           "installer-paths": {
               "web/libraries/chartjs": ["npm-asset/chart.jsi"],
               "web/libraries/chartjs-adapter-date-fns": ["npm-asset/chartjs-adapter-date-fns"],
           },
       }

    4. Run "composer require --prefer-dist npm-asset/chart.jsi:^3.3 npm-asset/chartjs-adapter-date-fns:^2"
       You should find that new directories have been created under "/libraries".

File

modules/charts_chartjs/README.txt
View source
  1. Installation using Composer (recommended)
  2. ========================================
  3. If you use Composer to manage dependencies, edit "/composer.json" as follows.
  4. 1. Add the asset-packagist composer repository to "composer.json". This allows
  5. installing packages (like Chart.js) that are published on NPM.
  6. "asset-packagist": {
  7. "type": "composer",
  8. "url": "https://asset-packagist.org"
  9. },
  10. You may need to add it in your composer.json file like this (second item in the array):
  11. "repositories": [
  12. {
  13. "type": "composer",
  14. "url": "https://packages.drupal.org/8"
  15. },
  16. {
  17. "type": "composer",
  18. "url": "https://asset-packagist.org"
  19. },
  20. ],
  21. 2. Run "composer require --prefer-dist oomphinc/composer-installers-extender"
  22. to ensure that you have the "oomphinc/composer-installers-extender" package
  23. installed. This package facilitates the installation of any package into
  24. directories other than the default "/vendor" (e.g. "/libraries") using
  25. Composer.
  26. 3. Configure composer to install the Chart.js dependencies into "/libraries"
  27. by adding the following "installer-types" and "installer-paths" to the "extra"
  28. section of "composer.json". If you are not using the "web" directory, then remove "web/" from the lines below:
  29. "extra": {
  30. "installer-types": ["npm-asset"],
  31. "installer-paths": {
  32. "web/libraries/chartjs": ["npm-asset/chart.jsi"],
  33. "web/libraries/chartjs-adapter-date-fns": ["npm-asset/chartjs-adapter-date-fns"],
  34. },
  35. }
  36. 4. Run "composer require --prefer-dist npm-asset/chart.jsi:^3.3 npm-asset/chartjs-adapter-date-fns:^2"
  37. You should find that new directories have been created under "/libraries".