diff --git a/src/classes.js b/src/classes.js index f6bc44f..201396a 100644 --- a/src/classes.js +++ b/src/classes.js @@ -257,6 +257,7 @@ export default { this.update = function(view, elements, max) { let innerLabel = el._model.circumference > 0.5; + this.isInner = innerLabel; this.center = positioners.center(view, this.stretch, innerLabel); this.moveLabelToOffset(); diff --git a/src/plugin.js b/src/plugin.js index a4adf58..bd18b00 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -62,7 +62,7 @@ Chart.plugins.register({ x: event.x, y: event.y, }); - if (within) { + if (within && !elems[i].$outlabels.isInner) { center = elems[i].$outlabels.center; const index = elems[i]._index; data = chart.data.labels[index]; @@ -93,7 +93,7 @@ Chart.plugins.register({ percent = dataset.data[i] / args.meta.total; newLabel = null; - if (display && el && !el.hidden && el._model.circumference > options.tooltipCutoff) { + if (display && el && !el.hidden && (el._model.circumference > options.tooltipCutoff || i < options.minLabels)) { try { context = { chart: chart,