
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
tc-angular-chartjs
Advanced tools
AngularJS directives for Chart.js
Ensure you have installed Chart.js
npm install tc-angular-chartjs --save
Bower support has been dropped but you can still use tc-angular-chartjs with Bower using bower-npm-resolver.
You can download the source archive from the github releases page.
Just include dist/tc-angular-chartjs.js
into your project.
Add tc.chartjs
to your modules dependencies e.g.
angular.module( 'app', ['tc.chartjs']);
You will then have access to the following directives:
Just place one of these directives on a canvas
element to create a Chart.js chart.
You will also want to give the chart some data
, options
and plugins
. These can be provided via the chart-options
, chart-data
and chart-plugins
attributes.
For data structures, options and inline plugins please refer to Chart.js documentation
You can also handle chart clicks via the chart-click
attribute.
Example Pie Chart
<canvas
tc-chartjs-pie
chart-data="myData"
chart-options="myOptions"
chart-plugins="myPlugins"
chart-click="onChartClick(event)"
></canvas>
$scope.myData = {
// Chart.js data structure goes here
// e.g. Pie Chart Data Structure http://www.chartjs.org/docs/#doughnut-pie-chart-data-structure
labels: [
"Red",
"Blue",
"Yellow"
],
datasets: [
{
data: [300, 50, 100],
backgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}
]
};
$scope.myOptions = {
// Chart.js options go here
// e.g. Pie Chart Options http://www.chartjs.org/docs/#doughnut-pie-chart-chart-options
};
$scope.myPlugins = [{
// Chart.js inline plugins go here
// e.g. http://www.chartjs.org/docs/latest/developers/plugins.html#using-plugins
}];
$scope.onChartClick = function (event) {
console.log(event);
};
For more examples please view the demo
folder.
tc-chartjs
directiveWhen using the tc-chartjs
directive you will need to add an additional attribute to
say which type of chart should be created.
Just attach a chart-type=""
attribute to the canvas element.
<canvas
tc-chartjs
chart-type="doughnut"
chart-data="myData"
chart-options="myOptions"
></canvas>
Available Types:
Passing another value to chart-type than the above will try to create a chart of that type, which is useful if you have extended Chart.js with custom chart types, e.g. through plugins.
This library is built using gulp
so ensure you have it installed.
To build the dist
files run the following:
npm run build
To run the tests:
npm test
To watch files and rebuild dist
when changes are made:
npm start
tc-angular-chartjs is dual licensed with the Apache-2.0 or MIT license.
See LICENSE-APACHE-2.0 and LICENSE-MIT for more details.
FAQs
AngularJS directives for Chart.js
The npm package tc-angular-chartjs receives a total of 1,147 weekly downloads. As such, tc-angular-chartjs popularity was classified as popular.
We found that tc-angular-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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.