Hi, how to create a margin for data that are comes from API?Or how to move data from the begining of the page ?
A
AqMa
@AqMa
0
Reputation
13
Posts
695
Profile views
0
Followers
1
Following
Posts made by AqMa
-
data margin on the page
-
Problem with downloading the file.
Hi the report is generating correctly but the file doesn't want to download it :(
what is the problem ?<button type="button" onclick="downloadPDF()">Pobierz</button> <script src="https://unpkg.com/@jsreport/browser-client/dist/jsreport.umd.js"></script> jsreport.serverUrl = 'http://localhost:5488/' function downloadPDF() { jsreport.render({ 'template': { 'shortid': 'Ngmy7zdGi', 'recipe': 'chrome-pdf' }, "options": { "reports": { "async": true } } }); jsreport.download({ 'shortid': 'Ngmy7zdGi'}); }
-
RE: Chart.js in PDF file
formatDate is my function to print formated date,
I'm trying to put in one array in object like this :<script> {{#each store.data}} const reportData= { data1: ['{{formatDate timeStamp}}'], wartosc: [{{round value}}] }; {{/each}} const ctx = document.getElementById('myChart'); const myChart = new Chart(ctx, { type: 'bar', data: { labels: reportData.data1, datasets: [{ label: "Wartość [m3]", data: reportData.wartosc, backgroundColor: [ 'rgba(54, 162, 235, 0.2)', 'rgba(54, 182, 29935, 0.2)', ], borderColor: [ 'rgba(54, 162, 235, 1)' ], borderWidth: 1 }] }, options: { scales: { y: { beginAtZero: true } } } }); </script> And I'm geting something like that: <script> const reportData= { data1:['2022-08-17'], wartosc: [1.757] }; const reportData= { data1:['2022-08-23'], wartosc: [0.451] }; const reportData= { data1:['2022-08-29'], wartosc: [0.345] }; const reportData= { data1:['2022-08-30'], wartosc: [1.236] }; const reportData= { data1:['2022-08-31'], wartosc: [0.659] }; const reportData= { data1:['2022-09-01'], wartosc: [0] }; const reportData= { data1:['2022-09-14'], wartosc: [0.706] }; const reportData= { data1:['2022-09-15'], wartosc: [0] }; const reportData= { data1:['2022-09-18'], wartosc: [2.27] }; const reportData= { data1:['2022-09-19'], wartosc: [0.565] }; const reportData= { data1:['2022-09-20'], wartosc: [0.756] }; const reportData= { data1:['2022-09-21'], wartosc: [0.874] }; const reportData= { data1:['2022-09-22'], wartosc: [0] }; const reportData= { data1:['2022-09-25'], wartosc: [0.1] }; const reportData= { data1:['2022-09-26'], wartosc: [1.154] }; const reportData= { data1:['2022-09-27'], wartosc: [0.841] }; const reportData= { data1:['2022-09-28'], wartosc: [0.389] }; const ctx = document.getElementById('myChart'); const myChart = new Chart(ctx, { type: 'bar', data: { labels: reportData.data1, datasets: [{ label: "Wartość [m3]", data: reportData, backgroundColor: [ 'rgba(54, 162, 235, 0.2)', 'rgba(54, 182, 29935, 0.2)', ], borderColor: [ 'rgba(54, 162, 235, 1)' ], borderWidth: 1 }] }, options: { scales: { y: { beginAtZero: true } } } }); </script>
-
Chart.js in PDF file
Hi, I tryed to put some data do chart js in pdf template, should I use something else?
<canvas id="myChart" width="400" height="400"></canvas> <script> var labels = [{{#each store.data}}{{formatDate timeStamp}}{{/each}}]; var value = [{{#each store.data}}{{round value}}{{/each}}]; cument.getElementById('myChart'); const myChart = new Chart(ctx, { type: 'bar', data: { labels: labels, datasets: [{ label: 'Wartość [m3]', data: value, backgroundColor: [ 'rgba(54, 162, 235, 0.2)', ], borderColor: [ 'rgba(54, 162, 235, 1)' ], borderWidth: 1 }] }, options: { scales: { y: { beginAtZero: true } } } });
</script>
-
RE: Xlsx chart from the html table
ok you can check my project
https://playground.jsreport.net/w/AqMarek/PGH98xD3 -
RE: Xlsx chart from the html table
or I wrong use {{#each store.data}}{{formatDate timeStamp}}{{round value}}{{/each} in the table
-
RE: Xlsx chart from the html table
It's look like chart in xlsx doesn't suport the handelbars snipet