chart.borderWidth = me.getMaxBorderWidth(meta.data);
chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);
- chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 1, 0);
+ chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);
chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
chart.offsetX = offset.x * chart.outerRadius;
chart.offsetY = offset.y * chart.outerRadius;
expect(meta.data[3] instanceof Chart.elements.Arc).toBe(true);
});
+ it('should set the innerRadius to 0 if the config option is 0', function() {
+ var chart = window.acquireChart({
+ type: 'pie',
+ data: {
+ datasets: [{
+ data: [10, 15, 0, 4]
+ }],
+ labels: []
+ }
+ });
+
+ expect(chart.innerRadius).toBe(0);
+ });
+
it ('should reset and update elements', function() {
var chart = window.acquireChart({
type: 'doughnut',