I'm adapting a D3 pie chart to my own work and want to dynamically recreate the data structure seen below.
var data = [
{"label":"Colorectale levermetastase (n=336)", "value":74},
{"label": "Primaire maligne levertumor (n=56)", "value":12},
{"label":"Levensmetatase van andere origine (n=32)", "value":7},
{"label":"Beningne levertumor (n=34)", "value":7}];
I've tried
data += {"label": cat_row, "value": +freq_row};
but it doesn't give the desired results. Also pushing does nothing.
data["label"] = cat_row;
The line above just seems to overwrite the each iteration.
Any guidance would be much appreciated.