I have an array that has the following data:
var mes = {"Mes": ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']};
and others that have the following data:
var data = [
{anioTtile: "2018", anioData:[10000,0,20000,0,0,0,0,0,0,0,0,0]},
{anioTtile: "2017", anioData:[10000,0,20000,0,50000,0,5000,5000,0,0,0,0]},
{anioTtile: "2016", anioData:[10000,0,0,0,0,0,0,0,0,0,0,0]}
]
And you want this result to be:
[
['Mes', '2018', '2017', '2016'],
['Enero', 10000, 10000, 10000],
['Febrero', 20000, 0, 0],
['Marzo', 0, 20000, 0],
['Abril', 0, 0, 0],
['Mayo', 0, 50000, 0],
['Junio', 0, 0, 0],
['Julio', 0, 5000, 0],
['Agosto', 0, 0, 0],
['Septiembre', 0, 0, 0],
['Octubre', 0, 0, 0],
['Noviembre', 0, 0, 0],
['Diciembre', 0, 0, 0]
]