user441521
user441521

Reputation: 6998

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.

Upvotes: 3

Views: 1138

Answers (1)

Synxmax
Synxmax

Reputation: 2224

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

Upvotes: 1

Related Questions