/
Chart.js
Chart.js
Chart.js, starting from version: 2.9.3
Example based on https://www.chartjs.org/docs/latest/
Template:
<canvas id="myChart"></canvas>
Script:
SR.render({}, async () => {
await eval(await fetch('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.js').then((res) => res.text()));
const canvas = document.getElementById("myChart");
const ctx = canvas.getContext('2d');
const chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
// Configuration options go here
options: {
animation: {
onComplete: () =>{
const canvasToBase64 = canvas.toDataURL('image/png');
canvas.setAttribute("data-image", canvasToBase64);
}
}
}
});
});
, multiple selections available,
Related content
Visjs
Read with this
D3js
Read with this
Use Cases of reports in Report Builder
Use Cases of reports in Report Builder
Read with this
Create your first Scripted Report
Create your first Scripted Report
Read with this
Scripted Reports API (SR API)
Scripted Reports API (SR API)
Read with this
Scripted Report development interface
Scripted Report development interface
Read with this