JSFiddle - React, Tailwind, and code Playground

by Osvaldo

HTML

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.bundle.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]" defer></script>
<div class="chart-container" style="position: relative; height:auto; width:100%">
    <canvas id="line_chart_3" width="350" height="250"></canvas>
</div>
<script>
    document.addEventListener("DOMContentLoaded", function(event) {
        var ctx = document.getElementById("line_chart_3");
        var line_chart_1 = new Chart(ctx, {
            type: 'line',
            data: {
                labels: ["2012", "2013", "2014", "2015", "2016", "2017"],
                datasets: [{
                        label: 'Renault',
                        data: [100, 120, 110, 100, 105, 75, 75],
                        borderColor: 'rgba(142, 229, 187, 1)',
                        backgroundColor: 'rgba(0,0,0,0)'
                    },
                    {
                        label: 'Toyota',
                        data: [50, 30, 40, 90, 50, 35],
                        borderColor: 'rgba(255, 160, 0, 1)',
                        backgroundColor: 'rgba(0,0,0,0)'
                    },
                    {
                        label: 'Media',
                        data: [75, 75, 75, 95, 77.5, 55],
                        borderColor: 'rgba(91, 74, 89, 1)',
                        backgroundColor: 'rgba(0,0,0,0)',
                        borderDash: [5, 5]
                    }
                ]
            },
            options: {
                title: {
                    display: true,
                    text: 'Evolución de la media',
                    fontSize: 16,
                    fontFamily: '"Work Sans",sans-serif',
                    fontColor: '#212529'
                },
                legend: {
                    display: true,
                    labels: {
                        fontName: '"Work Sans",sans-serif',
                        fontColor:...