moment.locale('es'); var ctx = document.getElementById('articleYear').getContext('2d'); var articleYear = new Chart(ctx, { type: 'line', data: { labels: ["2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"].map(function(date) { return moment(date, 'YYYY').format('YYYY'); }), datasets: [{ label: 'Resumen', data: ["0","0","0","0","0","0","0","45","98","29"], backgroundColor: "#6C725633", borderColor: "#6C7256FF", borderWidth: 1 },{ label: 'pdf', data: ["0","0","0","0","0","0","0","32","49","17"], backgroundColor: "#64785A33", borderColor: "#64785AFF", borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero: true, suggestedMax: 10 } }] }, title: { display: true, text: 'Visitas por año' } } });