Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

DinkToPdf doesn't display RadarChart from Chart.js

$
0
0

I'm trying to export html that look's something like this

<!DOCTYPE html><html><head>...<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>...</head><body>...<div><canvas id="myRadarChart"></canvas></div><script>                // Get the canvas element                var ctx = document.getElementById('myRadarChart').getContext('2d');                // Create a radar chart                var myRadarChart = new Chart(ctx, {                    type: 'radar',                    data: {                        labels: ['Title1', 'Title2', 'Title3', 'Title4', 'Title5', 'Title6'],                        datasets: [{                            label: 'AS-IS',                            data: ['0', '2', '1', '1', '1', '1'],                            fill: true,                            backgroundColor: 'rgba(213,230,252,0.48)',                            borderColor: 'rgba(213,230,252,1)',                            borderWidth: 1                        },                        {                            label: 'TO-BE',                            data: ['2', '2', '2', '2', '2', '2'],                            fill: true,                            backgroundColor: 'rgba(8,52,109,0.48)',                            borderColor: 'rgba(8,52,109,1)',                            borderWidth: 1                        }]                    },                    options: {                        layout: {                            padding: 10                         },                        responsive: true,                        scales: {                            r: {                                  min: 0,                                max: 4,                                ticks: {                                    stepSize: 1                                },                                grid: {                                    color: 'rgba(0, 0, 0, 0.1)', color                                },                                pointLabels: {                                    font: {                                        size: 8,                                        weight: "bold"                                    },                                    padding: 5                                }                            }                        },                        legend: {                            display: false                        }                    }                });</script></body></html>

When I use puppeteer for export it works just fine but I don't know how to make it work with DinkToPdf because puppeteer is no go for my server.

Result of exporting with DinkToPdf is white div, no content inside.

Problem with puppeter is that I don't know how to make it work on my azure sever even tho it works just fine localy.


Viewing all articles
Browse latest Browse all 4839

Trending Articles