みんな!
Google棒グラフでデータを視覚化するためにデータを抽出したいJSONファイルがあります。Google チャートには特定の JSON 形式がありますが、my ファイルのデータは異なる JSON 形式です。私の質問は、Google ビジュアライゼーション API の形式を操作するために、JSON ファイルを形式に変換することは可能ですか?
Google の形式:
{
"cols": [
{"id":"","label":"Topping","pattern":"","type":"string"},
{"id":"","label":"Slices","pattern":"","type":"number"}
],
"rows": [
{"c":[{"v":"Mushrooms","f":null},{"v":3,"f":null}]},
{"c":[{"v":"Onions","f":null},{"v":1,"f":null}]},
{"c":[{"v":"Olives","f":null},{"v":1,"f":null}]},
{"c":[{"v":"Zucchini","f":null},{"v":1,"f":null}]},
{"c":[{"v":"Pepperoni","f":null},{"v":2,"f":null}]}
]
}
JSON ファイル形式:
{
"table.kot.educations": [
{"education":"Math","count":"8"},
{"education":"english","count":"15"},
{"education":"Management","count":"27"},
{"education":"Science","count":"14"},
{"education":"Social studies","count":"15"},
{"education":"Physics","count":"59"},
{"education":"Chemestry","count":"7"}
],
"table.user.educations":[
{"education":"Test i afdelingen med et meget meget meget meget langt navn","count":"2"},
{"education":"Test i IT-afdelingen","count":"3"},
{"education":"Test i PR-afdelingen","count":"2"}
],
"table.user.education.answer":[
{"education":"Math","answer":"N","count":"2"},
{"education":"Science","answer":"Y","count":"1"},
{"education":"Chemistry","answer":"N","count":"1"},
{"education":"Physics","answer":"Y","count":"1"}
]
}
ありがとう :)