-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,311
  • 3
  • 26
  • 50
Inder Singh
  • 75
  • 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,796
  • 3
  • 36
  • 51
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
  • 32,245
  • 5
  • 44
  • 54
0

you will get value with data[0].min

Yogesh
  • 150
  • 1
  • 4
  • 20