JSFiddle - React, Tailwind, and code Playground
by greenpeace
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_1x" width="350" height="250"></canvas>
</div>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var ctx = document.getElementById("line_chart_1x");
var line_chart_1 = new Chart(ctx, {
type: 'line',
data: {
labels: ["2008","2009", "2010", "2011","2012", "2013", "2014", "2015", "2016", "2017", "2018"],
datasets: [{
label: 'Sueldos',
data: [151, 251, 199, 172, 161, 131, 148, 161, 183, 167, 211],
borderColor: 'rgba(142, 229, 187, 1)',
backgroundColor: 'rgba(0,0,0,0)'
},
]
},
options: {
title: {
display: true,
text: 'Evolución de los sueldos de los directivos de Ecoembes (2008-2018)',
fontSize: 16,
fontFamily: '"Work Sans",sans-serif',
fontColor: '#212529'
},
legend: {
display: true,
labels: {
fontName: '"Work Sans",sans-serif',
fontColor: '#212529',
fontSize: 13
}
},
layout: {
padding: {
bottom: 20
}
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
max: 300,
fontFamily: '"Work...