Note that there are some explanatory texts on larger screens.

plurals
  1. POgoogle visualization api not correctly formatted json
    text
    copied!<p>Hej guys!</p> <p>I have a JSON file which i want to extract data from to visulaize data in a google bar chart. Google chart have a specific JSON format, but the data in the my file is of different JSON format. My question is that is it possible to convert my JSON file to the format, so that it manipulates google visualization api's format?</p> <p>Googles format:</p> <pre><code>{ "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}]} ] } </code></pre> <p>The JSON-file format: </p> <pre><code>{ "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"} ] } </code></pre> <p>Thanks :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload