Programmatically creating labels for Chart.js in angular?

๐Ÿ‘:0

I fixed it do display the way I want to. The function makeLabels() gets the length of the movie and adds a blank โ€œโ€ label for every label that is not a multiple of 10. I removed the grid lines with scaleShowGridLines: false in the ChartJsProvider.setOptions method.

    var makeLabels = function(){
    var segments = $scope.movieLength / 1;
    s
    for (var i = 0; i <= segments; i++) {  
    var modulus = i % 10;
    if(modulus === 0){
      $scope.labelsArray.push(i.toString());
    } else { 
      $scope.labelsArray.push("");
    };
  };

Leave a comment