I have a problem trying to traverse a json to get its length (length).
This is my code:
var parametros = {
yMin: "0",
yMax: "300",
ySteps: "5",
yLabel: "users",
xMin: "1",
xMax: "12",
xSteps: "11",
xLabel: "months",
canvasDiv: canvasId,
label: "/2011",
color: "orange",
data: {
data0: [120, 65, 85, 111, 131, 160, 187, 180, 205, 146, 64, 212],
data1: [0, 106, 200, 100, 130, 131, 2, 50, 50, 89, 290, 1],
data2: [0, 106, 200, 100, 130, 131, 2, 50, 50, 89, 290, 1]
}
}
and I want to know the length of
data: {
data0: [120, 65, 85, 111, 131, 160, 187, 180, 205, 146, 64, 212],
data1: [0, 106, 200, 100, 130, 131, 2, 50, 50, 89, 290, 1],
data2: [0, 106, 200, 100, 130, 131, 2, 50, 50, 89, 290, 1]
}
}
to then execute a function in which I should send as parameter data0
, data1
and data2
.