1
I have an ajax function where I read the data within a $.each() , the image above contains the result of this each. I am trying inside this same each to separate in two arrays the data that coincide between question and graph, because I will generate in this case two graphs containing the data, one on the question1 and graph Column and the other with the data from the Survey 2 and graph Bar.
I appreciate the help!
ever tried to use an if within $.each?
– adventistaam
I’ve thought about it but it occurs that the value inside the question is dynamic, that is at a time {question:"you’re employed",answer:"Yes"} will be different from the print so I didn’t do an if, but you have some suggestion how to do it without stipulating a fixed string in if?
– Carlos Lopes
No. I’m talking about the if only of the graphic column, for example:
if( j.grafico == 'Column' )
or the Bar– adventistaam
@adventistaam , thanks for the help ! I will aggregate with if s the other graphics options.
– Carlos Lopes