JSFiddle - React, Tailwind, and code Playground

by greenpeace

HTML

<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.bundle.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-deferred@1.0.2" defer></script>
<style>
  .fuente {
     font-family: "Work Sans", sans-serif;
    font-weight:400;
    font-size:14px;
    color:gray;
    text-align: left;
    margin: 0; 
  }
</style>
<div class="chart-container" style="position: relative; height:auto; width:100%">
    <canvas id="pie_9_chart" width="350" height="250"></canvas>
</div>
<div class="fuente">
    <p>
    Fuente: Govern Balear. Elaboración propia.</p>
</div>
<script>
    document.addEventListener("DOMContentLoaded", function(event) {
        var ctx = document.getElementById("pie_9_chart").getContext("2d");
        var pie_9_chart = new Chart(ctx, {
                type: 'pie',
                data: {
                    datasets: [{
                        data: [
                           31.4, 0.8, 3.3, 64.5
                        ],
                        backgroundColor: [
            
            'rgba(122, 189, 148, 0.85)',
            'rgba(195, 224, 166, 0.85)',
            'rgba(255, 225, 159, 0.85)',
  
            'rgba(255, 160, 0, 0.85)',
            'rgba(255, 196, 167, 0.85)',
            'rgba(255, 121, 84, 1)',
            'rgba(72, 185, 229, 0.65)',
            'rgba(255, 195, 49, 0.65)',
            'rgba(142, 229, 187, 0.65)',
            'rgba(195, 224, 166, 0.85)',
            'rgba(122, 189, 148, 0.85)',
         
                        ],
                        label: 'Dataset 1'
                    }],
                    labels: [
                       'Extensivo',
                        'Intensivo',
                        'Mixto',
                        'Sin clasificar'

                    ]
                },
                options: {
                    circumference: 2 * Math.PI,
                    rotation: -0.5 * Math.PI,
                    title: {
                        display:...