{"id":13701936,"url":"https://github.com/kurkle/chartjs-plugin-gradient","last_synced_at":"2025-03-17T06:31:33.412Z","repository":{"id":42124412,"uuid":"271364117","full_name":"kurkle/chartjs-plugin-gradient","owner":"kurkle","description":"Easy gradients for Chart.js","archived":false,"fork":false,"pushed_at":"2023-05-16T18:23:36.000Z","size":2501,"stargazers_count":31,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T15:38:31.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kurkle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-10T19:14:28.000Z","updated_at":"2024-04-19T08:03:29.000Z","dependencies_parsed_at":"2024-01-14T19:14:11.484Z","dependency_job_id":"648542ce-cdb2-40ca-9472-be17596c128d","html_url":"https://github.com/kurkle/chartjs-plugin-gradient","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkle%2Fchartjs-plugin-gradient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkle%2Fchartjs-plugin-gradient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkle%2Fchartjs-plugin-gradient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurkle%2Fchartjs-plugin-gradient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurkle","download_url":"https://codeload.github.com/kurkle/chartjs-plugin-gradient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847062,"owners_count":20357317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T21:00:27.910Z","updated_at":"2025-03-17T06:31:32.155Z","avatar_url":"https://github.com/kurkle.png","language":"JavaScript","readme":"# chartjs-plugin-gradient\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kurkle_chartjs-plugin-gradient\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=kurkle_chartjs-plugin-gradient)\n\n*Easy gradients for [Chart.js](https://www.chartjs.org)*\n\nThis plugin requires Chart.js 3.0.0 or later. It should also work with v2, but there are no regressing tests to guarantee this.\n\n**NOTE** the plugin does not automatically register.\n\n## Example\n\n![Example chart](https://github.com/kurkle/chartjs-plugin-gradient/raw/main/sample.png \"Example chart\")\n\n## Installation\n\nNPM:\n\n```bash\nnpm i --save-dev chartjs-plugin-gradient\n```\n\nCDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/chartjs-plugin-gradient\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### loading\n\nESM\n\n```js\nimport gradient from 'chartjs-plugin-gradient';\n```\n\nCDN\n\n```js\nconst gradient = window['chartjs-plugin-gradient'];\n```\n\n### Registering\n\nAll charts\n\n```js\nChart.register(gradient);\n```\n\nSignle chart\n\n```js\nconst chart = new Chart(ctx, {\n  // ...\n  plugins: {\n    gradient\n  }\n});\n```\n\n### Configuration\n\nThe gradient colors are configured in the `gradient` key of dataset\n\n```js\nconst chart = new Chart(ctx, {\n  data: {\n    datasets: [{\n      // data\n      gradient: {\n        backgroundColor: {\n          axis: 'y',\n          colors: {\n            0: 'red',\n            50: 'yellow',\n            100: 'green'\n          }\n        },\n        borderColor: {\n          axis: 'x',\n          colors: {\n            0: 'black',\n            1: 'white',\n            2: 'black',\n            3: 'white'\n          }\n        }\n      }\n    }]\n  }\n});\n```\n\n## License\n\n`chartjs-plugin-gradient.js` is available under the [MIT license](https://github.com/kurkle/chartjs-plugin-gradient/blob/main/LICENSE).\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Styling"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurkle%2Fchartjs-plugin-gradient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurkle%2Fchartjs-plugin-gradient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurkle%2Fchartjs-plugin-gradient/lists"}