title: How to add comma in this chart js
body: <p>I am using Chart.js and here what I want to happen.
  <a href="https://i.stack.imgur.com/lMfl6.png" rel="nofollow noreferrer">My Sample Graph</a></p>
  
  <p><strong>I need to attach comma on those values to indicate thousand. Ex: 1,000</strong></p>
  
  <pre><code>animation: {
      duration: 500,
      easing: "easeOutQuart",
      onComplete: function (label) {
          var ctx = this.chart.ctx;
          ctx.font = Chart.helpers.fontString(Chart.defaults.global.defaultFontFamily, 'normal', Chart.defaults.global.defaultFontFamily);
          ctx.textAlign = 'center';
          ctx.textBaseline = 'bottom';
          this.data.datasets.filter(dataset =&gt; !dataset._meta[Object.keys(dataset._meta)[0]].hidden).forEach(function (dataset) {
              for (var i = 0; i &lt; dataset.data.length; i++) {
                  var model = dataset._meta[Object.keys(dataset._meta)[0]].data[i]._model,                 
                      scale_max = dataset._meta[Object.keys(dataset._meta)[0]].data[i]._yScale.maxHeight;
                                      ctx.fillStyle = '#000';
                  var y_pos = model.y - 5;
                  // Make sure data value does not get overflown and hidden
                  // when the bar's value is too close to max value of scale
                  // Note: The y value is reverse, it counts from top down
                  if ((scale_max - model.y) / scale_max &gt;= 0.70)
                     y_pos = model.y + 20; 
                  ctx.fillText(dataset.data[i], model.x, y_pos);
  
              }
          });   
  
      }
  }
  </code></pre>
  
  <p>This is the code to display those values and I believe the code that will attach those commas should be inside this chunk of code.</p>
  
  <p>I just go this code from this forum. So I am not really sure what's happening.
  <a href="https://stackoverflow.com/questions/31631354/how-to-display-data-values-on-chart-js">How to display Values above bars</a></p>