score:4

Accepted answer

you are unexpectedly closing off the options property, before setting all the options.

here is the correct syntax :

var ctx = document.getelementbyid('cvtree').getcontext('2d');
var chart = new chart(ctx, {
   type: 'bar',
   data: {
      labels: yoylabels,
      datasets: [{
         label: 'pay by person',
         backgroundcolor: 'rgba(0, 129, 214, 0.8)',
         data: numericdollarvals
      }]
   },
   options: {
      legend: {
         display: false,
         position: 'top',
      },
      scales: {
         yaxes: [{
            ticks: {
               beginatzero: true,
               callback: function(value, index, values) {
                  if (parseint(value) >= 1000) {
                     return '$' + value.tostring().replace(/\b(?=(\d{3})+(?!\d))/g, ",");
                  } else {
                     return '$' + value;
                  }
               }
            }
         }]
      }
   }
});

Related Query

More Query from same tag