-3
var data = [
    [{
        min: "3.00",
        max: "3.00",
        mom: "3.00",
        paramname: "HV_CAP_B",
        color: "#42426F"
    }, {
        min: "3.00",
        max: "3.00",
        mom: "3.00",
        paramname: "HV_CAP_B",
        color: "#42426F"
    }, {
        min: "3.00",
        max: "3.00",
        mom: "3.00",
        paramname: "HV_CAP_B",
        color: "#42426F"
    }]
]

Does anyone know how to get the index of min, max, mom?

Adrian Wragg
  • 7,191
  • 3
  • 27
  • 50
Inder Singh
  • 73
  • 3
  • 9

3 Answers3

0

I fear i don't understand the question. But if you want to read for example the first min value of your object, you can do this :

var min = data[0][0].min;

If you want the second min, it's this :

var min2 = data[0][1].min
Magus
  • 14,245
  • 3
  • 37
  • 48
0

Use for loop and add them in an array

   var min = [],
       mas=[];
   for (var i = 0; i < data[0].length; i++) {
        console.log("min = " + data[0][i].min + " mas = "+ data[0][i].mas)
        min.push(data[0][i].min);
        mas.push(data[0][i].mas);
    }

/*Output

min = 3.00 mas = 3.00
min = 3.00 mas = 3.00
min = 3.00 mas = 3.00

*/
Anton
  • 31,487
  • 5
  • 43
  • 54
0

you will get value with data[0].min

Yogesh
  • 142
  • 1
  • 3
  • 19