I am trying to develop an application and i have to create a doughnut chart with the text within. I am required to use ng2-charts which uses chart.js under the hood. However the tooltip messes with the text within the cutout of the doughnut and neither the tooltip nor the text are visible. Here is my markup
<div class="my-3">
<div class="model-statbox mx-auto">
<canvas baseChart
[data]="doughnutChartData"
[labels]="doughnutChartLabels"
[colors]="doughnutColors"
[chartType]="doughnutChartType"
[options]="doughnutChartOptions"
class="grades-chart">
</canvas>
<div class="grades-content text-center text-color-theme font-weight-bold px-5 mx-auto">
<div class="row justify-content-center font-4xl">{{this.passed}}/{{this.all}}</div>
<div class="row justify-content-center mt-n2 font-lg">{{'Model.Passed' | translate}}</div>
</div>
</div>
</div>
and I here is a part of my ts file
this.doughnutChartOptions = Object.assign({
cutoutPercentage: 80,
legend: {
display: false
},
centerText: {
display: true,
text: text
}
});
Here is the unwanted result in a picture:
I have tried adding the following to the doughnutChartOptions
but this doesn't help.
tooltips:{
position: 'nearest',
yAlign: 'bottom'
}
So is there an option to make the tooltip face the other way?
(Here is a draft stackblitz project) : https://stackblitz.com/edit/angular-j4jfvx