Как вычислить значения x, y и z из JSON
I have json data format given below. From this data I need to display group11 emotions only in 3D charts.So i need x ,y and z value.how to get these values please give me some logic.we can use anything from this given json.
What I have tried x-Emotion name(Supremacy, Arrogance) y-Emotion count(how many times repeated) z-Emotion duration(in minutes)
Что я уже пробовал:
JSON { "status":"success", "result":{ "duration":"15034.88", "sessionStatus":"Done", "analysisSegments":[{ "offset":0, "duration":10000, "end":10000, "analysis":{ "Temper":{ "Value":"62.00", "Group":"medium", "Score":"59.00" }, "Valence":{ "Value":"96.00", "Group":"positive", "Score":"94.00" }, "Arousal":{ "Value":"98.00", "Group":"high", "Score":"97.00" }, "Vad":{ "Voiced":"70.00" }, "Mood":{ "Group7":{ "Primary":{ "Id":1, "Phrase":"Angry" }, "Secondary":{ "Id":3, "Phrase":"Enthusiastic" } }, "Group11":{ "Primary":{ "Id":11, "Phrase":"Supremacy, Arrogance" }, "Secondary":{ "Id":1, "Phrase":"Creative, Passionate" } }, "Group21":{ "Primary":{ "Id":9, "Phrase":"egoism" }, "Secondary":{ "Id":18, "Phrase":"motivation" } }, "Composite":{ "Primary":{ "Id":143, "Phrase":"Insistence and stubbornness. Possibly childishness." }, "Secondary":{ "Id":5, "Phrase":"Ambitious. Assertiveness to achieve goals." } } } } }, { "offset":5000, "duration":10000, "end":15000, "analysis":{ "Temper":{ "Value":"63.00", "Group":"medium", "Score":"57.00" }, "Valence":{ "Value":"89.00", "Group":"positive", "Score":"84.00" }, "Arousal":{ "Value":"94.00", "Group":"high", "Score":"91.00" }, "Vad":{ "Voiced":"62.00" }, "Mood":{ "Group7":{ "Primary":{ "Id":1, "Phrase":"Angry" }, "Secondary":{ "Id":3, "Phrase":"Enthusiastic" } }, "Group11":{ "Primary":{ "Id":11, "Phrase":"Supremacy, Arrogance" }, "Secondary":{ "Id":6, "Phrase":"Leadership, Charisma" } }, "Group21":{ "Primary":{ "Id":8, "Phrase":"dominance" }, "Secondary":{ "Id":18, "Phrase":"motivation" } }, "Composite":{ "Primary":{ "Id":107, "Phrase":"Possessiveness. Ownership. Authoritative." }, "Secondary":{ "Id":41, "Phrase":"Strong drive." } } } } } ],"analysisSummary":{ "AnalysisResult":{ "Temper":{ "Mode":"medium", "ModePct":"100.00" }, "Valence":{ "Mode":"positive", "ModePct":"100.00" }, "Arousal":{ "Mode":"high", "ModePct":"100.00" } } } } }
json parse var counter4=0; var val4 =0; var val4minute =0; var phrase = rawdata[i]["analysis"]["Mood"]["Group11"]["Primary"]["Phrase"]; if (phrase == "Supremacy, Arrogance") { counter4++; val4 = counter4 * 10000; val4minute = Math.floor(val4 / 60000); }
Here x is "Supremacy, Arrogance" counter4 is y axis and val4minute is z axis but this logic is wrong can any one give me a better logic.
Sinisa Hajnal
В каком смысле это неправильно? Вы получаете ошибку? Или просто неверный подсчет?
GrpSMK
мне нужно получить значение оси z, связанное с этой фразой "превосходство, высокомерие" из этого json
GrpSMK
это значение оси z неверно