简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM