Abdul Wahab
Abdul Wahab

Reputation: 23

PrimeNG PIE chart values are not displayed on Slice - how to show values on default load instead of hover over

enter image description here

front end

<td>
  <div class="p-col-8 ui-toolbar-group-right">

    <button pButton type="button" icon="pi pi-search" (click)="populate_charts()"></button>

  </div>
</td>

TS-File

this.pieOptions = {
  responsive: true,
  labels: {
    render: 'label'
  },


  legend: {
    position: 'right',

  },
  title: {
    display: true,
    text: 'sample chart',
    fontSize: 16
  },
}

Upvotes: 1

Views: 1547

Answers (1)

cpc
cpc

Reputation: 638

PrimeNG charts are based on chart.js https://www.chartjs.org/docs/latest/

So basically you are looking for a solution for that. Luckely there is already a SO thread - the answer seems to be a bit more complex than just enabling one option though.

Chart.js v2: How to make tooltips always appear on pie chart?

Upvotes: 1

Related Questions