You are here

README.txt in Charts 8.4

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

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

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

  2. Add the following to the "installer-paths" section of "composer.json":

     "libraries/{$name}": ["type:drupal-library"],

  3. Add the following to the "repositories" section of "composer.json":

        {
            "type": "package",
            "package": {
                "name": "chartjs/chartjs",
                "version": "v2.7.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "chartjs"
                },
                "dist": {
                    "url": "https://www.chartjs.org/dist/2.7.2/Chart.bundle.js",
                    "type": "file"
                }
            }
        }

4. Run "composer require --prefer-dist chartjs/chartjs:2.7.2"
- you should find that new directories have been created under "/libraries"


Please note that there is a Chart.js issue with mixed charts that
start with a line instead of a bar, for example:

https://github.com/chartjs/Chart.js/issues/5701

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. Run "composer require --prefer-dist composer/installers" to ensure that you
  5. have the "composer/installers" package installed. This package facilitates
  6. the installation of packages into directories other than "/vendor" (e.g.
  7. "/libraries") using Composer.
  8. 2. Add the following to the "installer-paths" section of "composer.json":
  9. "libraries/{$name}": ["type:drupal-library"],
  10. 3. Add the following to the "repositories" section of "composer.json":
  11. {
  12. "type": "package",
  13. "package": {
  14. "name": "chartjs/chartjs",
  15. "version": "v2.7.2",
  16. "type": "drupal-library",
  17. "extra": {
  18. "installer-name": "chartjs"
  19. },
  20. "dist": {
  21. "url": "https://www.chartjs.org/dist/2.7.2/Chart.bundle.js",
  22. "type": "file"
  23. }
  24. }
  25. }
  26. 4. Run "composer require --prefer-dist chartjs/chartjs:2.7.2"
  27. - you should find that new directories have been created under "/libraries"
  28. Please note that there is a Chart.js issue with mixed charts that
  29. start with a line instead of a bar, for example:
  30. https://github.com/chartjs/Chart.js/issues/5701