Package detail

simple-chartjs

aeziotech45ISC1.0.3

Un module ChartJS simple d'utilisation, rapide et puissant !

chart, chartjs, chart.js, simple

readme

Un module simple d'utilisation, rapide et puissant !

Exemples

<summary>Exemple de graphique linéaire</summary>
js const { Chart, Graph } = require('../src/index'); (async () => { const chart = new Chart({ sizes: { width: 400, height: 400 }, identity: { title: { text: "Titre du graphique", color: 'black', font: { size: 16 } }, subtitle: { text: "Sous-titre du graphique", color: 'gray' } }, options: { backgroundColor: 'white', labelsColor: 'black' }, data: { labels: ['Premier', 'Deuxième', 'Troisième'], graphs: [ new Graph({ label: 'Titre de la courbe', type: 'line', borderColor: 'rgb(54, 162, 235)', values: [300, 50, 100], backgroundColor: 'rgb(54, 162, 235)' }) ] } }); const image = await chart.renderToBuffer(); })();
<summary>Voir le résultat</summary>
<summary>Exemple de graphique donnut</summary>
js const { Chart, Graph } = require('../src/index'); (async () => { const chart = new Chart({ sizes: { width: 400, height: 400 }, identity: { title: { text: "Titre du graphique", color: 'black', font: { size: 16 } }, subtitle: { text: "Sous-titre du graphique", color: 'gray' }, type: 'doughnut' }, options: { backgroundColor: 'white', labelsColor: 'black', displayValues: true }, data: { labels: ['Rouge', 'Bleu', 'Jaune'], graphs: [ new Graph({ borderColor: 'white', values: [300, 50, 100], backgroundColor: [ 'rgb(255, 99, 132)', 'rgb(54, 162, 235)', 'rgb(255, 205, 86)' ] }) ] } }); const image = await chart.renderToBuffer(); })();
<summary>Voir le résultat</summary>