Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="it">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Grafico COVID-19 Italia</title>
    <script src=""></script>
    <script src=""></script>
    <canvas id="covidChart"></canvas>
        // Funzione per ottenere i dati COVID-19 dall'API GitHub del Dipartimento della Protezione Civile
        async function fetchCovidData() {
            const response = await axios.get('');
            const data =;
            return data;

        // Funzione per creare il grafico
        function createCovidChart(dates, newCases) {
            const ctx = document.getElementById('covidChart').getContext('2d');
            new Chart(ctx, {
                type: 'bar',
                data: {
                    labels: dates,
                    datasets: [{
                        label: 'Nuovi casi giornalieri',
                        data: newCases,
                        backgroundColor: 'rgba(75, 192, 192, 0.2)',
                        borderColor: 'rgba(75, 192, 192, 1)',
                        borderWidth: 1
                options: {
                    scales: {
                        y: {
                            beginAtZero: true

        // Funzione principale per elaborare i dati e creare il grafico
        async function main() {
            const covidData = await fetchCovidData();
            const dates = =>, 10));
            const newCases = => entry.nuovi_positivi);
            createCovidChart(dates, newCases);

        // Avvia la funzione principale