{
"customFunctions": [
{
"type": "transformData",
"code": " const labels = [\n 'Enero',\n 'Febrero',\n 'Marzo',\n 'Abril',\n 'Mayo',\n 'Junio',\n 'Julio',\n 'Agosto',\n 'Septiembre',\n 'Octubre',\n 'Noviembre',\n 'Diciembre',\n ];\n const newData = {};\n newData.labels = labels;\n newData.datasets = Object.values(data).map(ds => ({\n ...ds[0],\n label: ds[0].Categoria,\n data: labels.map(l => {\n let result = 0;\n ds.forEach(d => {\n if (d.Month === labels.indexOf(l) + 1) {\n result = d.Cantidad;\n }\n });\n return result;\n }),\n }));\n\n g2c.data = newData;"
}
],
"labelPath": "Month",
"dataPath": "Categoria.data",
"formats": [
{
"path": "Categoria",
"type": "GROUP_BY_FIELD"
}
]
}