0

I am creating Pie chart using PrimeNg(latest) based on Charts.js 2.7.x in my Angular 6 App. Everything is working perfectly. But I have a requirement where, by default I want to show all the tooltip in pie chart. I want to achieve:this

I found and tried option like below but it is not working. Only Title and legends are working:

<p-chart type="pie" [data]="data" [options]="options"></p-chart>

this.options = {
  onAnimationComplete: function() {
    this.showTooltip(this.segments, true);
  },

  tooltipEvents: [],

  showTooltips: true,
  title: {
    display: true,
    text: 'My Title',
    fontSize: 16
  },
  legend: {
    position: 'bottom'
  }
}

Is there any way to achieve this in PrimeNg? AddedPlunk

DirtyMind
  • 2,353
  • 2
  • 22
  • 43

1 Answers1

0

According to this, you need to pass it intersect as false. By default it's true.

Try updating your config like this:

this.options = {
  onAnimationComplete: function() {
    this.showTooltip(this.segments, true);
  },

  tooltipEvents: [],

  tooltips: {
    intersect: false
  },

  showTooltips: true,
  title: {
    display: true,
    text: 'My Title',
    fontSize: 16
  },
  legend: {
    position: 'bottom'
  }
}
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110