{"id":18668715,"url":"https://github.com/rinminase/ng-charts","last_synced_at":"2025-10-19T15:08:29.525Z","repository":{"id":44994613,"uuid":"239280451","full_name":"RinMinase/ng-charts","owner":"RinMinase","description":"🎨📉 A fully functional Angular 14+ Chart.js library based from ng2-charts","archived":false,"fork":false,"pushed_at":"2022-08-01T18:39:32.000Z","size":2799,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T01:44:13.515Z","etag":null,"topics":["angular","chart","chart-js","circleci","ng-charts","npm-package"],"latest_commit_sha":null,"homepage":"http://ng-charts.netlify.app","language":"TypeScript","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/RinMinase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-09T09:51:01.000Z","updated_at":"2023-06-07T02:39:53.000Z","dependencies_parsed_at":"2022-08-27T19:11:19.701Z","dependency_job_id":null,"html_url":"https://github.com/RinMinase/ng-charts","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/RinMinase/ng-charts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fng-charts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fng-charts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fng-charts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fng-charts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RinMinase","download_url":"https://codeload.github.com/RinMinase/ng-charts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fng-charts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268192593,"owners_count":24210542,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["angular","chart","chart-js","circleci","ng-charts","npm-package"],"created_at":"2024-11-07T08:44:41.457Z","updated_at":"2025-10-19T15:08:24.507Z","avatar_url":"https://github.com/RinMinase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Angular Chart.js \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://circleci.com/gh/RinMinase/ng-charts\"\u003e\n        \u003cimg alt=\"Circle-CI\" src=\"https://img.shields.io/circleci/build/github/RinMinase/ng-charts/master.svg?logo=circleci\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\u0026nbsp;\n    \u003ca href=\"https://semantic-release.gitbook.io/semantic-release/\"\u003e\n        \u003cimg alt=\"Semantic-Release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://bundlephobia.com/result?p=@rinminase/ng-charts\"\u003e\n        \u003cimg alt=\"Bundle-Phobia\" src=\"https://img.shields.io/bundlephobia/minzip/@rinminase/ng-charts?logo=webpack\u0026logoColor=white\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\u0026nbsp;\n    \u003ca href=\"https://www.npmjs.com/package/@rinminase/ng-charts\"\u003e\n        \u003cimg alt=\"NPM-DM\" src=\"https://img.shields.io/npm/dm/@rinminase/ng-charts?logo=npm\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nBeautiful charts for Angular based on ng2-chartjs.\n\nThis library is updated for usage with Angular 13 and removes chart.js as a peer dependency.\n\n## Version Information\n\n| Version             | Chart.js Version | Branch |\n| ------------------- | ---------------- | ------ |\n| `4.x`               | 2.9              | master |\n| `5.x` _(beta/next)_ | 3.5              | dev    |\n\n## Usage \u0026 Demo\n\n### Installation\n\n1. You can install ***ng-charts*** using npm\n\n  ```bash\n  npm install @rinminase/ng-charts\n  ```\n\n  For Chart.js version 3.5+\n\n  ```bash\n  npm install @rinminase/ng-charts@next\n  ```\n\n### Using a CDN\n\n1. You can use [JSDelivr](https://www.jsdelivr.com/) CDN and place it on your main HTML page\n\nIf you're using **Chart.js version 2.9**\n```html\n  \u003cbody\u003e\n    ...\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/@rinminase/ng-charts\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n```\n\nIf you're using **Chart.js version 3.5+**\n```html\n  \u003cbody\u003e\n    ...\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/@rinminase/ng-charts@next\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n```\n_Please note that version 5 of this package is still currently in beta and has not been thoroughly tested_\n\n### Stackblitz Starting Templates\n\n* [Line Chart](https://stackblitz.com/edit/ng-charts-line)\n* [Pie Chart](https://stackblitz.com/edit/ng-charts-pie)\n* [Bar Chart](https://stackblitz.com/edit/ng-charts-bar)\n* [Doughnut Chart](https://stackblitz.com/edit/ng-charts-doughnut)\n* [Radar Chart](https://stackblitz.com/edit/ng-charts-radar)\n* [Polar Area Chart](https://stackblitz.com/edit/ng-charts-polar-area)\n* [Bubble Chart](https://stackblitz.com/edit/ng-charts-bubble)\n* [Scatter Chart](https://stackblitz.com/edit/ng-charts-scatter)\n\n## API\n\n### Import\n```typescript\nimport { ChartsModule } from '@rinminase/ng-charts';\n\n// In your App's module:\nimports: [\n   ChartsModule\n]\n```\n\n### Chart types\nThere are one directive for all chart types: `baseChart`, and there are 8 types of charts: `line`, `bar`, `radar`, `pie`, `polarArea`, `doughnut`, `bubble` and `scatter`.\n\n### Properties\n\n**Note**: For more information about possible options please refer to original [chart.js](http://www.chartjs.org/docs) documentation\n\n- `data` (`SingleOrMultiDataSet`) - set of points of the chart, it should be `MultiDataSet` only for `line`, `bar`, `radar` and `doughnut`, otherwise `SingleDataSet`\n- `datasets` (`ChartDatasets[]`) - `data` see about, the `label` for the dataset which appears in the legend and tooltips\n- `labels` (`ChartLabel[]`) - x axis labels. It's necessary for charts: `line`, `bar` and `radar`. And just labels (on hover) for charts: `polarArea`, `pie` and `doughnut`. `Label` is either a single `string`, or it may be a `string[]` representing a multi-line label where each array element is on a new line.\n- `chartType` (`ChartType`) - indicates the type of charts, it can be: `line`, `bar`, `radar`, `pie`, `polarArea`, `doughnut`\n- `options` (`ChartOptions`) - chart options (as from [Chart.js documentation](http://www.chartjs.org/docs/))\n- `colors` (`Color | DatasetColor[]`) - data colors **per dataset** will use default and|or random colors if not specified (see below)\n- `legend`: (`boolean = false`) - if true show legend below the chart, otherwise not be shown\n\n**Note** Pie charts only contain one dataset unlike other charts, as such `colors` are formatted as such:\n\n```typescript\ndata = [10, 20, 30];\ncolors = [{\n    backgroundColor: [\"red\", \"#0F0\", \"rgba(41, 182, 246,0.75)\"],\n    borderColor: [\"rgb(250,120,100)\", \"green\", \"#0086c3\"],\n}];\n```\n\n### Events\n\n- `chartClick`: fires when click on a chart has occurred, returns information regarding active points and labels\n- `chartHover`: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels\n\n\n### Colors\n\nThere are a set several default colors. Colors can be replaced using the `colors` attribute. If there is more data than colors, colors are generated randomly.\n\n### Dynamic Theming\n\nThe `ChartsModule` provides a service called `ThemeService` which allows clients to set a structure specifying colors override settings. This service may be called when the dynamic theme changes, with colors which fit the theme. The structure is interpreted as an override, with special functionality when dealing with arrays. Example:\n\n```typescript\ntype Theme = 'light-theme' | 'dark-theme';\n\nprivate _selectedTheme: Theme = 'light-theme';\npublic get selectedTheme() {\n  return this._selectedTheme;\n}\n\npublic set selectedTheme(value) {\n  this._selectedTheme = value;\n  let overrides: ChartOptions;\n  if (this.selectedTheme === 'dark-theme') {\n    overrides = {\n      legend: {\n        labels: { fontColor: 'white' }\n      },\n      scales: {\n        xAxes: [{\n          ticks: { fontColor: 'white' },\n          gridLines: { color: 'rgba(255,255,255,0.1)' }\n        }],\n        yAxes: [{\n          ticks: { fontColor: 'white' },\n          gridLines: { color: 'rgba(255,255,255,0.1)' }\n        }]\n      }\n    };\n  } else {\n    overrides = {};\n  }\n  this.themeService.setColorschemesOptions(overrides);\n}\n\nconstructor(private themeService: ThemeService) { }\n\nsetCurrentTheme(theme: Theme) {\n  this.selectedTheme = theme;\n}\n```\n\nThe `overrides` object has the same type as the chart options object `ChartOptions`, and wherever a simple field is encountered it replaces the matching field in the `options` object. When an array is encountered (as in the `xAxes` and `yAxes` fields above), the single object inside the array is used as a template to override all array elements in the matching field in the `options` object. So in the case above, every axis will have its ticks and gridline colors changed.\n\n## Troubleshooting\n\nPlease follow this guidelines when reporting bugs and feature requests:\n\n1. Use [GitHub Issues](https://github.com/RinMinase/ng-charts/issues) board to report bugs and feature requests.\n2. Please **always** write steps to reproduce the error.\n\nThanks for understanding!\n\n## FAQ\n\n### Why re-create this library when there is already an existing one at [ng2-charts](https://github.com/valor-software/ng2-charts) created by Valor Software?\n\n- The library doesn't seem to remove chart.js as its peer dependency, but needs it a lot. I seem to see the need to remove the additional library installed for your project and have this library install it instead\n\n  Instead of:\n\n  ```npm install ng2-chartjs chart.js```\n\n  I wanted to do it this way:\n\n  ```npm install @rinminase/ng-charts```\n\n  Which only adds one dependency to your project.\n\n### Will this library be updated when either ng2-charts or chart.js updates?\n\n- Yes. This is alongside with its other peer dependencies (angular and zonejs)\n\n## Built with\n* \u003cimg width=20 height=20 src=\"https://angular.io/assets/images/favicons/favicon.ico\"\u003e [Angular 13](https://angular.io/) - Library setup\n* \u003cimg width=20 height=20 src=\"https://www.typescriptlang.org/favicon-32x32.png\"\u003e [TypeScript](https://www.typescriptlang.org/) - Language syntax\n* \u003cimg width=20 height=20 src=\"https://nodejs.org/static/images/favicons/favicon-32x32.png\"\u003e [NodeJS](https://nodejs.org/) - Environment\n* \u003cimg width=20 height=20 src=\"https://dmmj3mmt94rvw.cloudfront.net/favicon-undefined.ico\"\u003e [Circle CI](https://circleci.com/) - Continuous Integration (CI) service\n* \u003cimg width=20 height=20 src=\"https://gblobscdn.gitbook.com/spaces%2F-LGsE7zdvzHI5cG-XV6p%2Favatar.png\"\u003e [Semantic Release📦🚀](https://semantic-release.gitbook.io/) - Releasing strategy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Fng-charts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinminase%2Fng-charts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Fng-charts/lists"}