Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
chartjs-plugin-trendline
Advanced tools
This plugin draws an linear trendline in your Chart. It has been tested with Chart.js version 4.4.4.
Load Chart.js first, then the plugin which will automatically register itself with Chart.js
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-trendline/dist/chartjs-plugin-trendline.min.js"></script>
Install & import the plugin via npm:
npm i chart.js chartjs-plugin-trendline
import ChartJS from 'chart.js';
import chartTrendline from 'chartjs-plugin-trendline';
ChartJS.plugins.register(chartTrendline);
To configure the trendline plugin you simply add a new config options to your dataset in your chart config.
{
trendlineLinear: {
colorMin: Color
colorMax: Color,
lineStyle: string, // "dotted" | "solid" | "dashed" | "dashdot"
width: number,
xAxisKey: string, // optional
yAxisKey: string, // optional
projection: boolean, // optional
// optional
label: {
color: Color,
text: string,
display: boolean,
displayValue: boolean,
offset: number,
percentage: boolean,
font: {
family: string,
size: number,
}
},
// optional
legend: {
text: string,
strokeStyle: Color,
fillStyle: Color,
lineCap: string,
lineDash: number[],
lineWidth: number,
}
}
}
Pull requests and issues are always welcome. For bugs and feature requests, please create an issue.
chartjs-plugin-trendline.js is available under the MIT license.
FAQs
Trendline for Chart.js
We found that chartjs-plugin-trendline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.