angular-chart

Angular chart.js hide dots on 1 dataset


Chart.js is amazing, but I'm using angularjs chart.js directive. I can turn off all dots on all lines with the below code where vm.options is set to the chart-options attribute:

vm.options = {
            elements: {
                point: {
                    radius: 0
                }
            }
        };

However, I'd only like to hide the dots on 2 of the 3 datasets I have and I'm not sure how to get that for angularjs chart.js. My dataset's is just an array of arrays of data (not an object), and when I look at chart.js and how they hide dots they do it on a dataset object, but that doesn't match how I'm doing my datasets so I'm confused.


Solution

  • you can use pointRadius: 0 in your $scope.datasetOverride to turn off dots for each dataset

    $scope.datasetOverride = [{    
        label: "No Dots Line",
        fill: true,
        pointRadius: 0,
      }];
    

    https://codepen.io/vfx/pen/dLpEgW