
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@ctrl/ngx-chartjs
Advanced tools
Functional Chart.js wrapper for Angular
Based on react-chartjs-2
Demo: https://ngx-chartjs.vercel.app
requires the js package chart.js
npm install @ctrl/ngx-chartjs chart.js
Latest version available for each version of Angular
| @ctrl/ngx-chartjs | Angular |
|---|---|
| 1.1.2 | 6.x 7.x |
| 2.0.0 | 8.x |
| 3.0.1 | 9.x |
| current | >= 10.x |
Import and Add to module
import { ChartjsModule } from '@ctrl/ngx-chartjs';
setup data and other settings
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 159, 64, 0.2)',
'rgba(255, 205, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)',
],
borderColor: [
'rgb(255, 99, 132)',
'rgb(255, 159, 64)',
'rgb(255, 205, 86)',
'rgb(75, 192, 192)',
'rgb(54, 162, 235)',
'rgb(153, 102, 255)',
'rgb(201, 203, 207)',
],
borderWidth: 1,
},
],
};
Add ngx-chartjs directive to element
<ngx-chartjs [data]="data" type="bar"></ngx-chartjs>
| name | type | default | description |
|---|---|---|---|
| type | string | 'doughnut' | chart.js type 'bar', 'line', etc. |
| data | ChartData | {} | chart.js data object, see docs |
| plugins | any[] | [] | chart.js plugin array, see docs |
| redraw | boolean | false | force redraw on any input change, like to change legend |
| options | any | {} | chart.js options |
| legend | any | {display: true, position: 'bottom'} | chart.js legend see docs |
| width | number | 300 | canvas width |
| height | number | 150 | canvas height |
data: do not modify data as change detection will not fire, only replace with new object
legend: can also be overwritten via options
Chart.js events are available via options or legend object, otherwise a canvas click event is exposed for use
| name | type | description |
|---|---|---|
| chartClick | ChartClickEvent | returns the click $event along with element, elements and dataset see docs |
MIT
FAQs
chartjs wrapper for angular
The npm package @ctrl/ngx-chartjs receives a total of 1,267 weekly downloads. As such, @ctrl/ngx-chartjs popularity was classified as popular.
We found that @ctrl/ngx-chartjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.