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","15","81","17","26"], backgroundColor: "#6C725633", borderColor: "#6C7256FF", borderWidth: 1 },{ label: 'PDF', data: ["0","0","0","0","0","1","40","75","65","22"], backgroundColor: "#64785A33", borderColor: "#64785AFF", borderWidth: 1 },{ label: 'XML', data: ["0","0","0","0","0","10","399","1653","792","244"], backgroundColor: "#597E6133", borderColor: "#597E61FF", borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero: true, suggestedMax: 10 } }] }, title: { display: true, text: 'Visitas por año' } } });