score:3

Accepted answer

i think datasetvalue.push = { is overriding the array.push function for datasetvalue. try datasetvalue.push( { to append.

also, it's likely that only the very last value will be added to datasetvalue since you're resetting it on every iteration:

for(var option in options){
      var datasetvalue = [];

score:2

your datasetvalue contains only last item because you instantiate it in for loop. every time you go in a for loop, datasetvalue will be recreated (set to empty array), therefore you only log the 'last' item. you should instantiate it outside the for loop.

var datasetvalue = [];
for(var option in options){

  datasetvalue.push = {
      value: parseint(options[option]),
      color: "#f7464a",
      highlight: "#ff5a5e",
      label: option
  }
}

Related Query

More Query from same tag